您的位置:首页 > 其它

xcode4.2 建 TabBar 项目,代理类修改如下

2017-10-17 18:08 183 查看
此TabBar结合了picker View

 

在代理类中加

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
UIViewController *datePickerView = [[[DatePickerViewController alloc] initWithNibName:@"DatePickerViewController" bundle:nil] autorelease];

UIViewController *singleComponentPickerView = [[[SingleComponentPickerViewController alloc] initWithNibName:@"SingleComponentPickerViewController" bundle:nil] autorelease];

UIViewController *doubleComponent = [[[DoubleComponentPickerViewController alloc]initWithNibName:@"DoubleComponentPickerViewController" bundle:nil] autorelease];

UIViewController *dependentComponent = [[[DependentComponentPickerViewController alloc]initWithNibName:@"DependentComponentPickerViewController" bundle:nil] autorelease];

UIViewController *customPicker = [[[CustomPickerViewController alloc]initWithNibName:@"CustomPickerViewController" bundle:nil] autorelease];

self.tabBarController = [[[UITabBarController alloc] init] autorelease];
self.tabBarController.viewControllers = [NSArray arrayWithObjects:datePickerView, singleComponentPickerView , doubleComponent, dependentComponent, customPicker, nil];

self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];
return YES;
}


MyPickerView.zip (108.3 KB)

下载次数: 6
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: