在attrs.xml中声明自定义视图属性有什么好处?

时间:2018-07-30 16:53:03

标签: android android-layout android-view

我目前正在试图理解为什么我需要在attrs.xml文件中定义View的自定义属性。当在自定义视图类中创建带有getter和setter的属性时,我已经可以在XML Layouts中使用该属性。然后,我也不需要从TypedArray中检索构造函数中的值。

0 个答案:

没有答案