可以指定单位:
setTextSize(int unit, int size)
TypedValue.COMPLEX_UNIT_PX : Pixels
TypedValue.COMPLEX_UNIT_SP : Scaled Pixels
TypedValue.COMPLEX_UNIT_DIP : Device Independent Pixels
mText.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
viewBinding.typeDistanceTv.setTextSize(TypedValue.COMPLEX_UNIT_SP, 17); viewBinding.typeTimeTv.setTextSize(TypedValue.COMPLEX_UNIT_SP, 15); viewBinding.typeCalTv.setTextSize(TypedValue.COMPLEX_UNIT_SP, 15);
最后
以上就是老实学姐最近收集整理的关于TextView动态设置字体大小 可以设置单位的全部内容,更多相关TextView动态设置字体大小内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复