我目前正在開發我的第一個應用程序,並且更改了UINavigationBar和UITabBar的大小,現在我在普通查看區域中有了額外的空間黑色空間(等ViewController,DetailViewController)。如何更改觀看區域以適應這種新尺寸?更改UINavigationBar和UITabBar的大小後的可視區域大小
我已經粘貼了我目前如何爲UINavigationBar和UITabBar設置新尺寸。
/* Get the screenarea of the device */
CGRect screenArea = [[UIScreen mainScreen] applicationFrame];
/* Define the size of the navigation bar */
CGRect viewHeaderbBarFrame = navigationBar.frame;
viewHeaderbBarFrame.origin.y = screenArea.origin.y;
viewHeaderbBarFrame.origin.x = screenArea.origin.x;
viewHeaderbBarFrame.size.height = 44;
viewHeaderbBarFrame.size.width = screenArea.size.width;
navigationBar.frame = viewHeaderbBarFrame;
/* Define the size of the footer bar */
CGRect viewTabBarFrame = tabBar.frame;
viewTabBarFrame.origin.y = screenArea.size.height - 26;
viewTabBarFrame.origin.x = screenArea.origin.x;
viewTabBarFrame.size.height = 46;
viewTabBarFrame.size.width = screenArea.size.width;
tabBar.frame = viewTabBarFrame;
謝謝。
偉大的答案和謝謝你的擡頭。 – 2012-08-15 00:57:51