IQKeyboardManager比較強(qiáng)大的對textFile呢撞、textView的鍵盤管理。
只需要在- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions函數(shù)中加入
IQKeyboardManager *manager = [IQKeyboardManager sharedManager];
manager.enable = YES;
manager.shouldResignOnTouchOutside = YES;
manager.shouldToolbarUsesTextFieldTintColor = YES;
manager.enableAutoToolbar = NO;
即可摧阅,不用再對IQKeyboardManager進(jìn)行其他的操作绷蹲,在項(xiàng)目中創(chuàng)建好textFile或者textView后,出現(xiàn)鍵盤祝钢,輸入完畢后,點(diǎn)擊背景就能收起鍵盤蜒什,還能對屏幕中低于鍵盤高度的textFile或者textView自動(dòng)進(jìn)行升高到鍵盤以上的位置處理疤估。