这只 uiscrollerview 的 setContentOffset

CGRect line = [textView caretRectForPosition:
textView.selectedTextRange.start];
CGFloat overflow = line.origin.y + line.size.height
- ( textView.contentOffset.y + textView.bounds.size.height
- textView.contentInset.bottom - textView.contentInset.top);
if ( overflow > ) {
// We are at the bottom of the visible text and introduced a line feed, scroll down (iOS 7 does not do it)
// Scroll caret to visible area
CGPoint offset = textView.contentOffset;
offset.y += overflow + ; // leave 7 pixels margin
// Cannot animate with setContentOffset:animated: or caret will not appear
// [UIView animateWithDuration:.2 animations:^{
// [textView setContentOffset:offset];
// }];
[textView setContentOffset:offset];
}

最新文章

  1. 测试机安装fd-server问题记录
  2. innodb数据结构
  3. [SQL]不知道
  4. Python之路【第五篇】:面向对象及相关
  5. springmvc 中常用的注解配置使用说明
  6. C# Socket服务器端如何判断客户端断开
  7. 深入理解php的MySQL连接类
  8. poj1185:炮兵阵地(状压dp)
  9. Solr导入数据库数据
  10. php7.0 和 php7.1新特性
  11. spring Boot+spring Cloud实现微服务详细教程第一篇
  12. tmux 后台训练
  13. 彻底搞懂Gradle、Gradle Wrapper与Android Plugin for Gradle的区别和联系
  14. rematch:当你受不了redux繁琐写法的时候,是时候了解一波rematch了
  15. layer is not defined
  16. 特征选择 (feature_selection)
  17. A - Dogs and Cages HDU - 6243(组合数学)
  18. cf786E ALT (最小割+倍增优化建图)
  19. P3594 [POI2015]WIL-Wilcze doły
  20. hibernate hql where语句拼接工具类

热门文章

  1. C# Winform中WndProc 函数作用
  2. 蜘蛛纸牌存档修改——python3.4.3
  3. PLSQL_数据泵定参数批量导入多表Expdp/Impdp Parfile(案例)
  4. python(15)提取字符串中的数字
  5. poj 2567 Code the Tree 河南第七届省赛
  6. maven PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path
  7. JAVA 文档注释,类的说明,HTML说明文档的生成
  8. 树莓派安装3.5inch RPi LCD (A)显示屏
  9. ArrayList,Vector线程安全性测试
  10. Python开发专业工具推荐