我想盡我所能複製UIImagePickerController。如果我在普通的UITableViewController中這樣做,它會顯示StatusBar半透明,並且您可以看到它背後的內容(就像在蘋果UIImagePickerController中一樣)。UIStatusBarStyleBlack透明在一個modalViewController內
self.wantsFullScreenLayout = YES;
self.navigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent;
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:YES];
但是,如果我提出一個新的UIViewController(帶一個UINavigationController作爲一個子視圖)作爲modalViewController:
[self.navigationController presentModalViewController:myImagePickerController animated:YES];
則狀態欄變得不透明,它仍然有這個深灰色的顏色,但你可以」沒有看到它背後的東西。是的,我有wantFullScreenLayout等在myImagePickerController viewDidLoad()方法。
如何解決這個問題,它的行爲像蘋果UIImagePickerController,一個帶有半透明StatusBar的模態視圖?
你可以在http://github.com/jeena/JPImagePickerController找到源代碼 – Jeena 2009-11-11 16:12:19