【发布时间】:2018-08-09 19:06:42
【问题描述】:
我看到了几个问题,由于 UIWebView 调用它,所以在显示 imagepicker 时应该调用函数 presentViewController:(UIViewController *)viewControllerToPresent animated:(BOOL)flag completion:(void (^)(void))completion{。
这是我的代码。
- (void)presentViewController:(UIViewController *)viewControllerToPresent animated:(BOOL)flag completion:(void (^)(void))completion{
if([viewControllerToPresent.class isEqual:[UIImagePickerController class]]){
UIImagePickerController *controller = (UIImagePickerController*)viewControllerToPresent;
controller.navigationBar.tintColor = UIColor.whiteColor;
[controller.navigationBar setTitleTextAttributes:
@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
[controller.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];
[controller.navigationBar setBarTintColor:[UIColor blackColor]];
}
[super presentViewController:viewControllerToPresent animated:flag completion:completion];
}
【问题讨论】:
标签: ios webview uiimagepickercontroller