TPKeyboardAvoidingScrollView 实现自动上滚,避免键盘遮盖住了textfield,textview等控件

时间:2014-02-17 19:16:25   收藏:0   阅读:2604

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"键。

原文:http://www.cnblogs.com/china-ldw/p/3552502.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!