UIImagePickerController iOS11調起相冊 中的照片被導航欄遮擋
為了適配iOS11下來刷新下下偏移問題啤斗,全局設置了[UIScrollView?appearance] 的ContentInsetAdjustmentBehavior為UIScrollViewContentInsetAdjustmentNever導致ScrollView向上偏移了表箭,而在iOS11以下卻沒問題
if(@available(iOS11.0, *)){
? ? ? ? [[UIScrollViewappearance] setContentInsetAdjustmentBehavior:UIScrollViewContentInsetAdjustmentNever];
? ? }
解決辦法:將導航條的毛玻璃效果去除掉就可以了
?UIImagePickerController *pickerController = [[UIImagePickerControlleralloc] init];
pickerController.editing=YES;
pickerController.delegate=self;
pickerController.allowsEditing=YES;
//? ? 去除毛玻璃效果
pickerController.navigationBar.translucent=NO;
? ? pickerController.sourceType=UIImagePickerControllerSourceTypePhotoLibrary;
[self presentViewController:pickerController animated:YEScompletion:nil];