2009-11-11 14 views
2

我想盡我所能複製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等在myI​​magePickerController viewDidLoad()方法。

如何解決這個問題,它的行爲像蘋果UIImagePickerController,一個帶有半透明StatusBar的模態視圖?

+0

你可以在http://github.com/jeena/JPImagePickerController找到源代碼 – Jeena 2009-11-11 16:12:19

回答

-1

嘗試從窗口展示它。

+0

你是什麼意思?我必須用presentModalViewController來呈現它:否則它的行爲不像蘋果UIImagePickerController。 – Jeena 2009-11-11 22:32:26

+0

這是什麼presentModalViewController是在引擎蓋下做的。 – CiNN 2009-11-11 23:36:01