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] ...
随机推荐
- 【模拟】XMU 1062 山东煎饼
题目链接: http://acm.xmu.edu.cn/JudgeOnline/problem.php?id=1062 题目大意: 已知金钱,和各面额钞票张数,问最少可以换成几张. 题目思路: [模拟 ...
- OAuth2的学习小结
Spring Security json Access maven OAUTH2核心参数说明 grant_type参数说明表格: grant_type 说明 authorization_code 标准 ...
- How to make onActivityResult get called on Nested Fragment
One of the common problem we always meet in the world of Fragment is: although we could callstartAct ...
- C# POST数据到指定页面,并跳转至该页面
/// <summary> /// 跨页面POST数据 /// </summary> public class RemotePost : Dictionary<strin ...
- 1036 : Trie图 (AC自动机)
题目大意: 输入 n 个目标单词和一个文本串,判断文本串中是否存在某些目标单词. 思路 赤裸裸的 AC自动机. 代码: #include<iostream> #include<cst ...
- Aggregating tests in suites
我们可以将来自不同类的test组成一个test suite.在JUnit 3.8.x我们使用 static Test suite()方法,但是在JUnit4我们使用在类前面加上注释 @RunWith( ...
- Linux 上使用 Gmail SMTP 服务器发送邮件通知
导读 假定你想配置一个 Linux 应用,用于从你的服务器或桌面客户端发送邮件信息.邮件信息可能是邮件简报.状态更新(如 Cachet).监控警报(如 Monit).磁盘时间(如 RAID mdadm ...
- K - Transformation-hdu 4578(多操作混合区间更新)线段树
题意:有四种操作 1, 区间 [l, r] 的值都加上 C 2, 区间 [l, r] 的值都乘上 C 3, 区间 [l, r] 的值都变为C 4, 求区间 [l, r]所有数的p次方的和 分析 ...
- 双slave的server_uuid同样问题
早上做数据迁移,部署完slave2,发现3台机子的日志狂刷: 旧slave: 2014-05-29 14:35:35 996 [Note] Slave: received end packet fro ...
- 如果ASM磁盘组由哪些物理磁盘组成?
我们知道用下面的方法可创建 ASM 磁盘,然后再创建逻辑的ASM组 以 root 用户身份创建 ASM 磁盘.# /etc/init.d/oracleasm createdisk VOL1 /dev/ ...