1
我想要在我的CustomTextView中的xml佈局中設置android:textColor。 我怎樣才能從AttributeSet attrs
得到它?從xml中定義的文本中獲取textColor屬性
我想要在我的CustomTextView中的xml佈局中設置android:textColor。 我怎樣才能從AttributeSet attrs
得到它?從xml中定義的文本中獲取textColor屬性
您可以試試這個:
final String androidNamespace = "http://schemas.android.com/apk/res/android";
String textColor = attrs.getAttributeValue(androidNamespace, "textColor");