iOS 11 咐蝇,如果給 UIImagePickerController 設(shè)置 allowsEditing = YES巷查,然后在編輯圖片的時候抹腿,卻發(fā)現(xiàn)左下角的那個 取消 按鍵怎么也沒法點擊到
讓你的類實現(xiàn) UINavigationControllerDelegate 接口,然后實現(xiàn)這個方法:
- (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;
}
}];
}
}