UITabBar customization

前端 未结 2 529
闹比i
闹比i 2020-12-06 08:10

This looks like a long shot, but does anyone know of a way to:

  1. Position a UITabBar on the top part of the screen
  2. Change it\'s height

Yo

相关标签:
2条回答
  • 2020-12-06 08:43

    I just wrote a category to change the tabbar's height

    you can check this out UITabBar height in iOS 5

    hope it will help you :)

    0 讨论(0)
  • 2020-12-06 08:44

    you don't need private API, just try this in your applicationDidFinishLaunching method.

    controller = [[UITabBarController alloc] initWithNibName:nil bundle:nil];
    
    HeadlinesViewController *headlines = [[HeadlinesViewController alloc] init];
    OpinionsViewController *opinions = [[OpinionsViewController alloc] init];
    
    controller.viewControllers = [NSArray arrayWithObjects:headlines, opinions, nil];
    
        // set your position , width and height there
    controller.tabBar.frame = CGRectMake(0, 20, 320, 50);
    [window addSubview:controller.view ];
    [window makeKeyAndVisible];
    
    0 讨论(0)
提交回复
热议问题