更新时间:2022-11-19 13:44:32
据我知道你有2个选择:
As I know you have 2 options:
的TextView
并具有构造函数的AttributeSet
您自己的看法。然后,你可以在这个构造器自定义属性。检查本教程:创建一个视图类 TextView
and has constructor that takes AttributeSet
. Then you can get custom property in this constructor. Check this tutorial: Creating a View Class.***检查一下这个问题:如何读取Android的自定义属性这几乎是一样的。
Better check this question: How to read custom attributes in Android it's almost the same.