用視圖上移解決UITextField/UITextView被鍵盤遮蓋問題

先看看UILabel/UITextField/UITextView的區別:
html

UILabel 顯示的文本只讀,沒法編輯,能夠根據文字個數自動換行;
UITextField 可編輯本文,可是沒法換行,只能在一行顯示;當點擊鍵盤上的return時會收到一個事件作一些事情。
UITextView 可編輯文本,提供換行功能。

解決UITextField/UITextView被鍵盤遮蓋問題能夠主要參考https://gist.github.com/ruandao/9429305ios

先記着,有時間作一些整理
git


參考連接:github

https://gist.github.com/ruandao/9429305app

https://developer.apple.com/library/ios/documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.htmlui

How to make UITextField move up when keyboard is present
htm

相關文章
相關標籤/搜索