addChildViewController 用法
//
// SCMyOrderViewController.m
// SmartCommunity
//
// Created by chenhuan on 15/9/7.
// Copyright (c) 2015年 smartcommunity. All rights reserved.
// #import "SCMyOrderViewController.h"
#import "JPTabViewController.h"
#import "SCAllOrderViewController.h"
#import "SCWatiPayViewController.h"
@interface SCMyOrderViewController ()<JPTabViewControllerDelegate>{
SCAllOrderViewController *allvc;
SCWatiPayViewController *waitpayvc;
} @end @implementation SCMyOrderViewController - (void)viewDidLoad {
[super viewDidLoad];
self.labelTitle.text=@"我的订单"; allvc = [[SCAllOrderViewController alloc] init];
[allvc setTitle:@"全部"]; waitpayvc = [[SCWatiPayViewController alloc] init];
[waitpayvc setTitle:@"待付款"]; UIViewController *blueController = [[UIViewController alloc] init];
[blueController setTitle:@"待评价"]; JPTabViewController *tabViewController = [[JPTabViewController alloc] initWithControllers:@[allvc, waitpayvc, blueController]];
[self addChildViewController:tabViewController];
tabViewController.view.y=64;
[self.view addSubview:tabViewController.view];
tabViewController.delegate=self; } -(void)viewWillAppear:(BOOL)animated{
AppDelegate *app = [[UIApplication sharedApplication] delegate];
[app.inher HiddenBar];
[super viewWillAppear:animated];
} - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (void)currentTabHasChanged:(NSInteger)selIndex{
NSLog(@"%d",selIndex);
if(selIndex==0){ //全部
[allvc viewDidAppear:NO]; }else if(selIndex==1){ //待付款
[waitpayvc viewDidAppear:NO];
}else if(selIndex==2) { //待评价 }
} @end
addChildViewController 用法的更多相关文章
- iOS开发 关于addChildViewController的理解
iOS开发 关于addChildViewController的理解 前言 我之前是做Android开发的接触ios开发不到一个月的时间,所以在有些东理解上会不自觉的向Android方向靠拢. 理解 通 ...
- EditText 基本用法
title: EditText 基本用法 tags: EditText,编辑框,输入框 --- EditText介绍: EditText 在开发中也是经常用到的控件,也是一个比较必要的组件,可以说它是 ...
- jquery插件的用法之cookie 插件
一.使用cookie 插件 插件官方网站下载地址:http://plugins.jquery.com/cookie/ cookie 插件的用法比较简单,直接粘贴下面代码示例: //生成一个cookie ...
- Java中的Socket的用法
Java中的Socket的用法 Java中的Socket分为普通的Socket和NioSocket. 普通Socket的用法 Java中的 ...
- [转载]C#中MessageBox.Show用法以及VB.NET中MsgBox用法
一.C#中MessageBox.Show用法 MessageBox.Show (String) 显示具有指定文本的消息框. 由 .NET Compact Framework 支持. MessageBo ...
- python enumerate 用法
A new built-in function, enumerate() , will make certain loops a bit clearer. enumerate(thing) , whe ...
- [转载]Jquery中$.get(),$.post(),$.ajax(),$.getJSON()的用法总结
本文对Jquery中$.get(),$.post(),$.ajax(),$.getJSON()的用法进行了详细的总结,需要的朋友可以参考下,希望对大家有所帮助. 详细解读Jquery各Ajax函数: ...
- 【JavaScript】innerHTML、innerText和outerHTML的用法区别
用法: <div id="test"> <span style="color:red">test1</span> tes ...
- chattr用法
[root@localhost tmp]# umask 0022 一.chattr用法 1.创建空文件attrtest,然后删除,提示无法删除,因为有隐藏文件 [root@localhost tmp] ...
随机推荐
- pl/sql 在一个程序块里打印日志输出到表格
declare v_number NUMBER; v_number2 NUMBER; begin execute immediate 'truncate table t2'; insert into ...
- JAVA首选五款开源Web开发框架
Spring Spring是一个开源的Java/Java EE全功能栈应用程序框架,在JavaEE社区中非常受欢迎,以Apache许可证形式发布,也有.NET平台上的移植版本. Struts2 Str ...
- BZOJ1709: [Usaco2007 Oct]Super Paintball超级弹珠
1709: [Usaco2007 Oct]Super Paintball超级弹珠 Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 324 Solved: ...
- 【线段树】HDU 5443 The Water Problem
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5443 题目大意: T组数据.n个值,m个询问,求区间l到r里的最大值.(n,m<=1000) ...
- Hbase与RDBMS
hbase与传统关系数据库区别 hbase适合于非结构化数据存储的数据库.介于Map Entry 和 DB row之间的一种数据存储方式. 1. 数据类型: HBase只有简单的字符串类型,它只保存字 ...
- Delphi 托盘程序实现 转
unit MainUnit; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, F ...
- 【性能测试】【Jmeter】学习(2)——录制一段脚本
打开JMeter工具,录制一段脚本(我做的是录制登陆网站后点击设备的开关设定,然后再退出) 1).创建一个线程组(右键点击“测试计划”--->“添加”---->“线程组”) 2).添加录制 ...
- EditText输入长度动态控制,最大长度为16位,小数点后面最大为2位,输入整数只能为13位
首先在xml 中把inputType设置为numberDecimal (包含小数点)然后在把maxLeng设置为16 package com.example.numbertest; import an ...
- wikioi 1044 拦截导弹 (1999年NOIP全国联赛提高组)
题目描述 Description 某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能高于前一发的高度.某 ...
- 【COM学习】之一、QueryInterface
开始先说一句,学习com之前要学好c++ 对象模型. QueryInterface的使用: QueryInterface是IUnknown的一个成员函数,客户可以通过此函数来查询某个组件是否支持某个特 ...