iOS11 打开系统相册 导航栏透明 且列表的frame也不对

如图
clipboard.png
clipboard.png

代码
self.picker = [[UIImagePickerController alloc] init];//初始化self.picker.allowsEditing = YES;//设置可编辑
self.picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
self.picker.delegate = self;
[self presentViewController:self.picker animated:YES completion:nil];//进入相册界面

这种情况只在iOS11出现了,我的其他手机没有问题

阅读 4.7k
2 个回答

我也遇到这个,是这样解决的
原因应该是全局设置了UIScrollView.appearance.contentInsetAdjustmentBehavior,导致系统相册出现的问题
if (@available(iOS 11, *)) {

    UIScrollView.appearance.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentAutomatic;
}

在进入的时候
if (@available(iOS 11, *)) {

    UIScrollView.appearance.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentAutomatic;
}

在选择照片或退出时候
if (@available(iOS 11, *)) {

    [UIScrollView appearance].contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; //iOS11 解决SafeArea的问题,同时能解决pop时上级页面scrollView抖动的问题
}
新手上路,请多包涵

请问一下,问题解决了吗,我也遇到相同的问题····

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题