3
即時通訊使用UIImagepickercontroller拍攝照片並選擇現有照片,當相機視圖出現時,相機的頂部被白色狀態欄覆蓋。我如何刪除狀態欄或隱藏狀態欄。他們中的很多人說它是ios 7的bug,它已經在ios 7.1中修復了,但是我仍然面臨這個問題。iOS 7和iOS 8中UIImagepickercontroller相機視圖的狀態欄重疊
這是我的代碼,以顯示imagepickerController
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = (id)self;
imagePicker.sourceType = (buttonIndex == actionSheet.firstOtherButtonIndex ?
UIImagePickerControllerSourceTypeCamera : UIImagePickerControllerSourceTypePhotoLibrary);
[self.viewController presentViewController:imagePicker animated:YES completion:nil];
此外,我試圖用下面的代碼隱藏狀態欄
- (void)navigationController:(UINavigationController *)navigationController
willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
[[UIApplication sharedApplication] setStatusBarHidden:YES];
}
這
-(BOOL) prefersStatusBarHidden {
return YES;
}
而這代表
[UIApplication ShareApplication]SetStatusbarHidden:YES];
現在我正在使用ios8,而這種行爲發生在所有ios版本中。 請幫我一把。
我遇到同樣的問題。在iOS7中,我通過繼承UIImagePickerController並重寫prefersStatusBarHidden爲YES來解決它。但在iOS8上它停止工作。如果您找到解決方案,請告訴我! – hybridcattt 2014-09-30 16:15:20