我使用UINavigationController的id來使用導航欄的一個典型情況。設置其界限和框架似乎不會有所作爲,即時通訊使用此代碼我如何設置UINavigationBar在iphone應用程序中的高度
//set up the navigation
UINavigationController *navigationController = [UINavigationController new];
[navigationController.navigationBar setBarStyle:UIBarStyleBlack];
[navigationController.navigationBar setTintColor:[UIColor purpleColor]];
[navigationController.navigationBar setBounds:CGRectMake(0.0, 0.0, 480.0, 100.0)];
[navigationController.navigationBar setFrame:CGRectMake(0.0, 0.0, 480.0, 100.0)];
但無濟於事。有任何想法嗎?
你說得對,它不是繼承,想着其他的事情而寫的問題。至於'new',必須從某處複製代碼 – 2009-09-07 01:16:36
新方法只是alloc/init的快捷方法。以完全相同的方式工作。 – horseshoe7 2011-08-01 10:11:19