ios tabbar customization with images

前端 未结 3 1749
说谎
说谎 2021-01-16 05:31

i\'m working in ios application i need to customize tabbar to be like this

First I created 5 viewcontrollers each one in navi

3条回答
  •  伪装坚强ぢ
    2021-01-16 06:04

    In the AppDelegate.m file, add the following code. In that piece of code, we are creating four views and adding them to a Tab Controller. These views are empty for now because we don’t need any content in them for the purposes of this project.

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    
    {
    
        self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    
        UITabBarController *tabController = [[UITabBarController alloc] init];  
    
    
        UIViewController *viewController1 = [[UIViewController alloc] init];  
    
    
        UIViewController *viewController2 = [[UIViewController alloc] init];  
    
    
        UIViewController *viewController3 = [[UIViewController alloc] init];    
    
    
        UIViewController *viewController4 = [[UIViewController alloc] init];  
    
        tabController.viewControllers = [NSArray arrayWithObjects:viewController1, 
    
                                         viewController2, 
    
                                         viewController3, 
    
                                         viewController4, nil];
    
        self.window.rootViewController = tabController;  
    
    
        [self.window makeKeyAndVisible];
    
        return YES;
    
    }
    

    You can see a good tutorial here

提交回复
热议问题