425_缩小TextView字体到两行
2016-12-01 23:00
197 查看
缩小TextView字体到两行
runnable = new Runnable() {
@Override
public void run() {
int lineCount = tv.getLineCount();
if (lineCount > 2) {
float textSize = tv.getTextSize();
textSize--;
tv.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
tv.post(runnable);
}
}
};
tv.post(runnable);
runnable = new Runnable() {
@Override
public void run() {
int lineCount = tv.getLineCount();
if (lineCount > 2) {
float textSize = tv.getTextSize();
textSize--;
tv.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
tv.post(runnable);
}
}
};
tv.post(runnable);
相关文章推荐
- 一个TextView设置不同大小字体、EditText显示两行不同样式hint
- android 利用一个TextView实现两行并且每行的字体大小和颜色各异
- 代码中设置TextView字体加粗
- TextView显示不同颜色字体
- android textview 用html设置字体
- 让TextView展示不同颜色字体,让局部字体拥有点击事件
- Android textview字体颜色显示和图片显示
- android中用Spannable在TextView中设置超链接、颜色、字体
- android中用Spannable在TextView中设置超链接、颜色、字体
- Android 自定义TextView实现文本内容自动调整字体大小以适应TextView的大小
- android 一个 textview 设置不同的字体大小和颜色
- android的TextView展示带格式文本、首行缩进、引入自定义字体
- textView 的设置文本中某一文字的字体颜色以及图文混排
- Android TextView 动态改变字体颜色、大小
- selector修改TextView中字体的颜色
- android中用Spannable在TextView中设置超链接、颜色、字体
- Android实战技巧:用TextView实现Rich Text---在同一个TextView中设置不同的字体风格
- android textview设置字体的行距和字间距
- Android TextView使用HTML处理字体样式、显示图片等
- 自定义view控件之TextView可以包含两种不同的字体风格