`问题`
1、进入页面直接弹起输入框
2、收回输入框后视图整体上移
解决方案
1、Appdelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
IQKeyboardManager.sharedManager.enable = YES;
}
2、ViewController
#pragma mark - Life Cycle Methods
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[[IQKeyboardManager sharedManager] setEnable:NO];
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[[IQKeyboardManager sharedManager] setEnable:YES];
}
网友评论