设置文字大小setTextSize()
API描述:
public void setTextSize (int unit, float size)
Added in API level 1
Set the default text size to a given unit and value. See TypedValue for the possible dimension units.
Related XML Attributes
android:textSize
Parameters
unit The desired dimension unit.
size The desired size in the given units.
eg.
setTextSize(TypedValue.COMPLEX_UNIT_DIP, dpSize);
setTextSize(TypedValue.COMPLEX_UNIT_PX, pxSize);
setTextSize(TypedValue.COMPLEX_UNIT_SP, spSize);
本文介绍了setTextSize() API 的使用方法,此方法用于设置文本的默认大小,可以通过不同的单位来指定文本尺寸,如像素(PX)、设备独立像素(DIP)等。文章提供了具体的示例代码。
337

被折叠的 条评论
为什么被折叠?



