TPKeyboardAvoiding
git:https://github.com/michaeltyson/TPKeyboardAvoiding
用法:
1,將TPKeyboardAvoiding目錄添加到工程中;
2,在viewController對應的XIB中,加一個UIScrollView,將scrollView類屬性設置為TPKeyboardAvoiding;
3,在代碼中讓UIScrollView調用 [self.scrollViewcontentSizeToFit];
4,把你需要的textfield,textview加到UIScrollView上;
OK,這樣textfield,textview就能實現自動上滾,並且自動設置鍵盤的"return"鍵。