在我的应用程序中,我不显示状态栏。在 IOS 7 中,我必须在 info plist 中添加“基于控制器的状态栏外观”,这很好,但是当我使用以下代码时:
imagePicker.allowsEditing = YES;
imagePicker.sourceType = (sender == self.chooseImageBtn && [UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) ? UIImagePickerControllerSourceTypeCamera :
UIImagePickerControllerSourceTypeSavedPhotosAlbum;
[self presentViewController:imagePicker animated:YES completion:nil];
状态栏再次显示,即使我添加了以下代码:
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];