uitextview 最后一行遮挡
2024-10-16 05:00:33
这只 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];
}
最新文章
- 测试机安装fd-server问题记录
- innodb数据结构
- [SQL]不知道
- Python之路【第五篇】:面向对象及相关
- springmvc 中常用的注解配置使用说明
- C# Socket服务器端如何判断客户端断开
- 深入理解php的MySQL连接类
- poj1185:炮兵阵地(状压dp)
- Solr导入数据库数据
- php7.0 和 php7.1新特性
- spring Boot+spring Cloud实现微服务详细教程第一篇
- tmux 后台训练
- 彻底搞懂Gradle、Gradle Wrapper与Android Plugin for Gradle的区别和联系
- rematch:当你受不了redux繁琐写法的时候,是时候了解一波rematch了
- layer is not defined
- 特征选择 (feature_selection)
- A - Dogs and Cages HDU - 6243(组合数学)
- cf786E ALT (最小割+倍增优化建图)
- P3594 [POI2015]WIL-Wilcze doły
- hibernate hql where语句拼接工具类
热门文章
- C# Winform中WndProc 函数作用
- 蜘蛛纸牌存档修改——python3.4.3
- PLSQL_数据泵定参数批量导入多表Expdp/Impdp Parfile(案例)
- python(15)提取字符串中的数字
- poj 2567 Code the Tree 河南第七届省赛
- maven PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path
- JAVA 文档注释,类的说明,HTML说明文档的生成
- 树莓派安装3.5inch RPi LCD (A)显示屏
- ArrayList,Vector线程安全性测试
- Python开发专业工具推荐