- UIImagePickerController 编辑图片时的左下
- UIImagePickerController 编辑/选取图片时
- UIImagePickerController 编辑/选取图片时
- UIImagePickerController 编辑/选取图片时
- iOS11 UIImagePickerControllerEdi
- UIImagePickerController-iOS11+左下
- 相册拾取器UIImagePickerController
- [工具]简书-MarkDown上手
- UIImagePickerController编辑页面电池栏无背
- 如何避免UIImagePickerController选择照片时
在 iOS 11 下,如果给 UIImagePickerController 设置 allowsEditing = YES,然后在编辑图片的时候,却发现左下角的那个 取消 按键怎么也没法点击到
解决方法:
只需在使用 UIImagePickerController 的delegate方法中添加一下代码即可
- (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
if ([UIDevice currentDevice].systemVersion.floatValue < 11) {
return;
}
if ([viewController isKindOfClass:NSClassFromString(@"PUPhotoPickerHostViewController")]) {
[viewController.view.subviews enumerateObjectsUsingBlock:^(__kindof UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
if (obj.frame.size.width < 42) {
[viewController.view sendSubviewToBack:obj];
*stop = YES;
}
}];
}
}
网友评论