zoukankan      html  css  js  c++  java
  • iOS UITabViewController use


    1 appdelegate.m

      #import "AppDelegate.h"


    #import "FirstViewController.h"


    #import "SecondViewController.h"

    #import "ThridViewController.h"

     

    {

        self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];

        // Override point for customization after application launch.

        UIViewController *viewController1 = [[[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil] autorelease];

        UIViewController *viewController2 = [[[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil] autorelease];

        UIViewController *viewControll3 =[[[ThridViewController alloc] initWithNibName:@"ThridViewController" bundle:nil] autorelease];

        

        self.tabBarController = [[[UITabBarController alloc] init] autorelease];

        self.tabBarController.viewControllers = [NSArray arrayWithObjects:viewController1, viewController2,viewControll3, nil];

        self.window.rootViewController = self.tabBarController;

        [self.window makeKeyAndVisible];

        return YES;

    }

    2 FirstViewController.h

    @interface FirstViewController : UIViewController


    @end

    3 FirstViewController.m

    - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil

    {

        self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];

        if (self) {

            self.title = NSLocalizedString(@"First", @"First");

            self.tabBarItem.image = [UIImage imageNamed:@"first"];

        }

        return self;

    }

  • 相关阅读:
    Mysql主外键
    行列转换
    简单的增删改查
    day22 面向对象基础
    day21 xml模块 ATM+购物车
    python学习 day19 configparser模块 os模块 subprocess模块
    day18 logging模块 sys shelve
    day17 正则表达式 re模块和hashlib模块
    day16 包的使用 json time 常用模块
    day15模块内容
  • 原文地址:https://www.cnblogs.com/csj007523/p/2642762.html
Copyright © 2011-2022 走看看