美文网首页
UIImagePickerController iOS11调起相

UIImagePickerController iOS11调起相

作者: iOS开发小学生 | 来源:发表于2019-11-19 13:42 被阅读0次

    为了适配iOS11下来刷新下下偏移问题,全局设置了 [UIScrollView appearance] 的ContentInsetAdjustmentBehavior为UIScrollViewContentInsetAdjustmentNever导致ScrollView向上偏移了,而在iOS11以下却没问题

    if (@available(iOS 11.0, *)){
    
            [[UIScrollView appearance] setContentInsetAdjustmentBehavior:UIScrollViewContentInsetAdjustmentNever];
    
        }
    

    解决办法:将导航条的毛玻璃效果去除掉就可以了

     UIImagePickerController *pickerController = [[UIImagePickerController alloc] init];
    
        pickerController.editing = YES;
    
        pickerController.delegate = self;
    
        pickerController.allowsEditing = YES;
    
    //    去除毛玻璃效果
    
        pickerController.navigationBar.translucent = NO;
    
        pickerController.sourceType=UIImagePickerControllerSourceTypePhotoLibrary;
    
        [self presentViewController:pickerController animated:YES completion:nil];
    

    相关文章

      网友评论

          本文标题:UIImagePickerController iOS11调起相

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