2010-04-02 88 views
4

這看起來像一個長鏡頭,但沒有人知道的方式:在屏幕的頂部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];