IQKeyboardManager 是常用的控制輸入鍵盤彈出的控件,使用時(shí)直接將該控件導(dǎo)入項(xiàng)目
當(dāng)使用UITextField 和 UITextView時(shí)可以根據(jù)彈出鍵盤改變輸入框位置,但是使用YYTextView時(shí),輸入時(shí)YYTextView并不會(huì)根據(jù)彈出的鍵盤改變位置,而是彈出的鍵盤遮擋了輸入框。解決改問題只需在程序啟動(dòng)時(shí)加上下面代碼即可
[[IQKeyboardManager sharedManager]registerTextFieldViewClass:[YYTextView class]
didBeginEditingNotificationName:YYTextViewTextDidBeginEditingNotification
didEndEditingNotificationName:YYTextViewTextDidEndEditingNotification];