- 浏览: 415719 次
- 性别:
- 来自: 上海
文章分类
最新评论
-
IThead:
纠结了几天,用了你的方法,现在解决了,谢谢!
Eclipse 写Javascript卡死问题 -
Rubicon__:
你好,我在运用PageWidget这个类时,出现第一页翻到第二 ...
android翻书效果实现原理( 贝塞尔曲线绘制原理/点坐标计算) -
lionios:
如果不显示printDialog,则打印出来的是空白页,请问你 ...
Print打印机例子 -
rayln:
weiqiulai 写道哥们儿,我怎么没有看到监控队列的配置和 ...
JMS监听MQ实例 -
weiqiulai:
哥们儿,我怎么没有看到监控队列的配置和代码?
JMS监听MQ实例
通过UITabBarController去实现多页面切换效果
例子
例子
// // AppDelegate.h // Tab1 // // Created by Rayln Guan on 9/24/13. // Copyright (c) 2013 Rayln Guan. All rights reserved. // #import <UIKit/UIKit.h> @class ViewController; @class SecondViewController; @interface AppDelegate : UIResponder <UIApplicationDelegate>{ UITabBarController *tab; } @property (strong, nonatomic) UIWindow *window; @property (strong, nonatomic) ViewController *viewController; @property (strong, nonatomic) SecondViewController * sec; @end
// // AppDelegate.m // Tab1 // // Created by Rayln Guan on 9/24/13. // Copyright (c) 2013 Rayln Guan. All rights reserved. // #import "AppDelegate.h" #import "ViewController.h" #import "SecondViewController.h" @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. self.viewController = [[ViewController alloc] init]; self.sec = [[SecondViewController alloc] init]; tab = [[UITabBarController alloc] init]; [tab setViewControllers:[[NSArray alloc] initWithObjects:self.viewController, self.sec, nil] animated:YES]; self.window.rootViewController = tab; [self.window addSubview:tab.view]; [self.window makeKeyAndVisible]; return YES; } - (void)applicationWillResignActive:(UIApplication *)application { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } - (void)applicationDidEnterBackground:(UIApplication *)application { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } - (void)applicationWillEnterForeground:(UIApplication *)application { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } - (void)applicationDidBecomeActive:(UIApplication *)application { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } - (void)applicationWillTerminate:(UIApplication *)application { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } @end
// // ViewController.h // Tab1 // // Created by Rayln Guan on 9/24/13. // Copyright (c) 2013 Rayln Guan. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end
// // ViewController.m // Tab1 // // Created by Rayln Guan on 9/24/13. // Copyright (c) 2013 Rayln Guan. All rights reserved. // #import "ViewController.h" @interface ViewController () @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. self.title = @"first"; UITabBarItem *item1 = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemBookmarks tag:0]; self.tabBarItem = item1; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } @end
发表评论
-
【iOS-Cocos2d游戏开发之十四】音频/音效/视频播放(利用Cocos2D-iPhone-Extensions嵌入Cocos2d进行视频播放!)
2013-11-18 11:04 655李华明Himi 原创,转载务必在明显处注明: 转载自【黑米Ga ... -
MAC系统下COCOS2D-X(IPHONE-ANDROID)及IDE的开发环境搭建
2013-11-11 16:30 1206最近正在做移动多平台对应游戏框架的调查,因为之前业余时间一直使 ... -
CCCallFunc
2013-11-08 14:08 657猴子原创,欢迎转载。转载请注明: 转载自Cocos2D开发网– ... -
Sprite Kit学习笔记(一)初探
2013-11-06 21:23 1080转载:http://blog.csdn.net/k ... -
绘制图形
2013-10-15 13:40 708转载:http://book.2cto.com/201304/ ... -
CocosBuilder各元素渲染完成后的回调函数
2013-10-13 18:00 1085在调用ccbi文件后很多时候需要做一次元素渲染完成后的回调函数 ... -
Retina屏幕的支持
2013-10-12 15:54 4451。 由于retina和普通屏像素相差2倍,所以需要一套高清图 ... -
ccTouchesBegan 中如何让获取的坐标是相对整个屏幕的坐标,而不是在当前view的坐标
2013-10-11 13:36 735ccTouchesBegan 中如何让获取的坐标是相对整个屏幕 ... -
关于内存管理的几个基本要点!!(例子)
2013-10-08 15:25 622首先:如果alloc一个对象就必须要释放代码 比如: Te ... -
Cocos2d与chipmunk的使用
2013-10-04 22:08 1255新建一个cocos2d-chipmunk项目 首先AppDel ... -
定位程序出错位置
2013-10-03 15:03 662在.m文件中加入 #ifdef _FOR_DEBUG_ -( ... -
多线程之NSThread、NSOperation、NSInvocationOperation
2013-10-01 21:46 726IOS中支持多线程操作,使用NSThread和NSInvoca ... -
简单的数据存储
2013-09-26 10:09 720// // ViewController.h // d ... -
TabView的使用
2013-09-24 13:57 956多页面的tab使用,就是ActionBar。直接看例子 其实就 ... -
TableView分组Group写法
2013-09-22 17:05 803需要多实现方法 首先需要在xib的视图文件中修改TableVi ... -
TableView的使用
2013-09-22 16:19 675在界面上拖一个TableView控件在可视区域。定义一个Pro ... -
实现alert弹出框
2013-09-22 10:34 732首先需要先实现UIAlertViewDelegate协议,这样 ... -
Copy方法
2013-09-13 22:42 758NSArray NSMutableArray copy NSA ... -
NSObject 和 反射的使用
2013-09-13 15:50 946// // main.m // Refect // ... -
NSNull
2013-09-09 16:30 671NSNull是为了解决字典等各种类不能放null而用的,这个对 ...
相关推荐
模仿手Q底部TabView icon跟着手指动
TabBarsAnimationDemo — 底部菜单push隐藏菜单栏动画(仿<京东> 及 <东方财富通> tabBar效果)
Android类似新浪微博底部、微信底部Tab实现代码
android+flutter实现tab主框架,用tabview实现底部5个tab的展示和页面切换
标题本来是设置下划线高度的,但是感觉有歧义,额,高度设置的话,在layout xml文件里tabIndicatorHeight=“xdp”就行了,本文后面讲的是设置该下划线距离底部的高度。为什么会有这种奇怪的需求呢?因为设计稿就是...
本机脚本菜单使用分段栏创建应用程序自定义的... NativeScript NS安卓不支持tabview底部布局,使用segmented-bar模拟,但是感觉效率不如tabview ,真是醉了。用了一周的NS,感觉真是不太好。。屏幕截图执照麻省理工学院
这是经过修改的React Native社区TabView,它返回在TabUtilsExample中使用的onPositionChange回调。 在您的index.js中, import TabUtilsExample from "react-native-tab-utils/TabUtilsExample";添加import ...
这是一个自定义的TabBar样式,实现TabBar中间凸起“ ”按钮
$ ./tabview_init.sh your_new_project 或带有底部标签: $ ./bottom_init.sh your_new_project (记住react-native链接react-native-vector-icons,保留Info.plist,然后取消链接) 用ReactNative开发的应用 ...
PS:同样要在iOS上进行材质设计,可以免费使用插件 此插件未使用任何第三个库,这意味着该插件是轻量级的,因为只有javascript文件会添加到您的应用中。 的iOS 安卓 安装 tns plugin add nativescript-bottombar...
它是新设计的底部栏(也可以用作顶部导航栏)。 具有不同设计的演示 设计#1 设计#2 设计#3 标签徽章 选择后 安装 将其添加到存储库末尾的root build.gradle中: allprojects { repositories { ... ...