IQKeyboardManager和UIScrollView问题
如果在ScrollVIew上添加UITextField 或者
UITextView等文本编辑,要用第三方键盘IQKeyboardManager时 一定要把
把UIScrollView作为根视图 scrollView上的textFiled 等文本编译才不会出现不可编辑的问题
IQKeyboardManager简单使用
1,在AppDelegate里添加
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[IQKeyboardManager sharedManager] setToolbarManageBehaviour:IQAutoToolbarByPosition];
return YES;
}
//在使用的controller里添加
- (void)loadView//用ScrollView
{
[super loadView];
UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:[UIScreen mainScreen].bounds];
scrollView.contentSize = CGSizeMake(self.view.frame.size.width, 1000);
scrollView.backgroundColor=[UIColor redColor];
self.view = scrollView;
}
- (void)viewDidLoad {
[super viewDidLoad];
IQKeyboardReturnKeyHandler *retuenKeyHandler = [[IQKeyboardReturnKeyHandler alloc]initWithViewController:self];
retuenKeyHandler.lastTextFieldReturnKeyType =UIReturnKeyDone;
}