1

按照这个关于如何在 UIImagePicker 隐藏状态栏后将状态栏设置为不隐藏的建议。(现在怎么还没解决?)

我正在使用GKImagePicker,它添加了一个可扩展的裁剪界面。它的使用方式与图像选择器控制器相同,将自己设置为委托,然后以模态方式呈现控制器。

我认为放置状态栏解决方法的最佳位置是它的委托方法,如下所示:

- (void)imagePicker:(GKImagePicker *)imagePicker pickedImage:(UIImage *)image
{
    [self.imagePicker.imagePickerController dismissViewControllerAnimated:YES
                                                               completion:^{
        self.imageView.image = image;

        // Workaround for UIImagePickerController hidden status bar bug
        [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationSlide];

    }];
}

- (void)imagePickerDidCancel:(GKImagePicker *)imagePicker
{
    [self.imagePicker.imagePickerController dismissViewControllerAnimated:YES
                                                               completion:nil];

    [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationSlide];
}

取消后,一切正常,状态栏愉快地滑入到位。When picking an image though, the status bar comes bar overlays my navigation bar, and the navigation bar's top corner is drawn at (0,0). 是什么赋予了?

4

0 回答 0