我需要一個UIImagePickerCOntroller,以便用戶可以拍一些照片。這是我的代碼:UIImagePickerController不總是全屏(奇怪的狀態欄行爲)
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
UIImagePickerController * imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.delegate = self;
imagePicker.showsCameraControls = YES;
imagePicker.allowsEditing = YES;
imagePicker.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentViewController:imagePicker animated:YES completion:nil];
}
我第一次打開UIImagePickerController一切正常!但第二,第三......時間我總是得到這樣的:
正如你所看到的相機控制上述被削減。它看起來像StatusBar是問題。我什麼都試過,如:
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
[[UIApplication sharedApplication] setStatusBarHidden:YES];
}
或
[[UIApplication sharedApplication] setStatusBarHidden:YES];
但毫無效果。也許是Apple Bug?
感謝您的迴應,但沒有任何改變... – Davis
@Davis你仍然發現狀態欄? – Mayur
有沒有狀態欄,當我打開UIImagePickerController,但仍然像上面screenhot黑色區域...也許狀態欄不是問題.. – Davis