问题描述
当输入结束的时候,状态栏变为白色,与自己定义的导航栏颜色形成鲜明的对比.
解决方案
找到IQKeyboardManager框架中IQUIView+Hierarchy.m文件修改
-(UIViewController*)topMostController
方法中的代码。
实现如下:
-(UIViewController *)topMostController
{
UIViewController *rootController = [UIApplication sharedApplication].keyWindow.rootViewController;
if([rootController isKindOfClass:[UITabBarController class]]){
UITabBarController *tabBarController = (UITabBarController*)rootController;
UINavigationController*navController = tabBarController.selectedViewController;
UIViewController*viewController = (UIViewController*)navController.visibleViewController;
while(viewController.presentedViewController) {
viewController = (UIViewController*)viewController.presentedViewController;
}
return viewController;
}else if([rootController isKindOfClass:[UINavigationController class]]) {
UINavigationController *navController = (UINavigationController*)rootController;
return navController.visibleViewController;
}else if([rootController isKindOfClass:[UIViewController class]]) {
return rootController;
}else{
return nil;
}
}
实现效果: