i need a UIImagePickerCOntroller, so that the User can take some photos. This is my Code:
- (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];
}
For the first time i open the UIImagePickerController everything works fine! But for the Second, third... time i always get this:
As you can see the Camera Controls above gets cut. It looks like the StatusBar is the Problem. I tried everything like:
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
[[UIApplication sharedApplication] setStatusBarHidden:YES];
}
or
[[UIApplication sharedApplication] setStatusBarHidden:YES];
But nothing worked. Maybe an Apple Bug?
Try this :
Implement - (BOOL)prefersStatusBarHidden
in your view controller and return YES
or NO
based on the current conditions. When you want to hide/show, call - (void)setNeedsStatusBarAppearanceUpdate
on your view controller.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.