UITabBar定制

Mih*_*ian 4 cocoa-touch objective-c uitabbarcontroller uikit uitabbar

这看起来像是一个长镜头,但有人知道一种方法:

  1. 将UITabBar放在屏幕的顶部
  2. 改变它的高度

欢迎您推荐私有API方法

小智 5

你不需要私有API,只需在你的applicationDidFinishLaunching方法中尝试这个.

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];
Run Code Online (Sandbox Code Playgroud)