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

来源:互联网 发布:java 游戏设计教程pdf 编辑:程序博客网 时间:2024/06/05 16:13

此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
原创粉丝点击