- UIImagePickerController 编辑/选取图片时
- UIImagePickerController 编辑/选取图片时
- UIImagePickerController 编辑/选取图片时
- UIImagePickerController编辑页面电池栏无背
- iOS11 UIImagePickerControllerEdi
- UIImagePickerController 编辑图片时的左下
- 图片选取器UIImagePickerController
- 相册拾取器UIImagePickerController
- UIImagePickerController
- UIImagePickerController拍照录像相册
问题描述:
当UIImagePickerControlle属性allowsEditing设置为YES时,在编辑/选取图片的时候,却发现左下角的那个 取消 按键非常的难点击。
原因:
视图调试和使用测试控件,如图能看到在左侧有一个未知来源的透明的View控件,尺寸(height为屏幕高,宽度在iphone6下为13、Plus以上为41.4),其遮挡了cancelButton。
问题如图:
Simulator Screen Shot - iPhone 6 Plus - 2018-09-21 at 10.43.20.png解决办法:
1.实现代理:UINavigationControllerDelegate、 xxx.delegate = self;
2.实现方法:
- (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;
}
}];
}
}
网友评论