自定义控件 获取textSize的坑。。

1. declare-styleable

自定义控件 获取textSize的坑。。_第1张图片

2. 获取文字大小

3. 关键部分是这里,setTextSize要用下面这个带俩参数的,而不是直接setTextSize(textSize),不然字体会变得特别大。

link: http://stackoverflow.com/questions/16596980/how-to-read-custom-dimension-attribute-from-java-code

你可能感兴趣的:(自定义控件 获取textSize的坑。。)