美文网首页
UIImagePickerController 被导航栏挡住

UIImagePickerController 被导航栏挡住

作者: hankielao | 来源:发表于2019-10-16 10:28 被阅读0次

1:

在AppDelegate.m设置了

if (@available(iOS 11.0, *)) {

        [[UIScrollView appearance] setContentInsetAdjustmentBehavior:UIScrollViewContentInsetAdjustmentNever];

}

2:

在打开相册前设置

if (@available(iOS 11, *)) {

        UIScrollView.appearance.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentAutomatic;

}

3:

- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<NSString *,id> *)info

方法中设置

if (@available(iOS 11, *)) {

        UIScrollView.appearance.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;

}

以上三步设置完就正常了

相关文章

网友评论

      本文标题:UIImagePickerController 被导航栏挡住

      本文链接:https://www.haomeiwen.com/subject/tgeymctx.html