【问题汇总】文本高度与字号不一致的问题
来源:互联网 发布:食品研究与数据分析 编辑:程序博客网 时间:2024/05/05 21:37
设计UI的时候,发现TextView在布局上占用的高度和属性textSize的大小不一样,要比textSize要来的大(例如textSize="12dp",实际的高度大概有14-16dp)。
仔细看的话会发现文字的上方和下方都留有空白,这严重影响布局的效果。
经过调研,发现TextView有一个属性,通过修改这个属性能够解决这个问题。
android:includeFontPaddingLeave enough room for ascenders and descenders instead of using the font ascent and descent strictly. (Normally true).Must be a boolean value, either "true" or "false".This may also be a reference to a resource (in the form "@[package:]type:name") or theme attribute (in the form "?[package:][type:]name") containing a value of this type.This corresponds to the global attribute resource symbol includeFontPadding.Related Methods setIncludeFontPadding(boolean)
参考资料
http://developer.android.com/reference/android/widget/TextView.html#attr_android:includeFontPadding
0 0
- 【问题汇总】文本高度与字号不一致的问题
- 文本长度与字符长度不一致的问题
- body高度与内容总高度不一致问题
- 胶囊体高度不一致问题
- 重写ListView解决item高度不一致的问题
- Axure RP Pro - 相关问题 - 线框中的字号与原型中的字号的关系
- IOS字体大小,字号的问题
- TextView高度和文字高度不一致!美工给的尺寸在eclipse做完显示不一致的问题!
- TextView控件高度大于文本高度问题
- 解决div与span等inline元素同行后高度不一致问题
- IOS字体大小,字号的问题 UIFont
- IOS字体大小,字号的问题 UIFont
- IOS字体大小,字号的问题 UIFont
- [概念]iOS字体大小,字号的问题
- cocos2dx EditBox 设置字号大小的问题
- [iOS]iOS的字号转换问题
- [iOS]iOS的字号转换问题
- 关于UI给的字号问题
- 如何将java的int类型的4个字符变成C++需要的int类型
- JAVA文件操作——RandomAccessFile 的用法
- 做IOS开发这一年
- 推送教程
- 第九周项目 5 程序填空题(1)
- 【问题汇总】文本高度与字号不一致的问题
- Java线程:线程状态的转换(特别是join的理解)
- ftp文件下载时压缩包数据损失的问题
- 改变TextView中邮件、链接、电话的文字颜色
- 解决Android NDK: WARNING: APP_PLATFORM android-14 is larger than
- R:递归
- Java面试全集
- 我的第一次程序编写
- CocoaPods详解之----使用篇