1
我有子类的偏好,并在attrs.xml创建的自定义styleables如下:如何通过派生类访问Android内部样式属性?
<declare-styleable name="MyPreference">
<attr name="myAttribute" format="reference" />
</declare-styleable>
,我可以在XML声明我的偏好如下:
<com.my.project.MyPreference
android:title="myTitle"
namespace:myAttribute="@array/sleep_time_values" />
我可以访问自定义属性刚罚款:
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.MyPreference, 0, 0);
thing = a.getText(R.styleable.MyPreference_myAttribute);
我的问题是:如何访问(在代码中)在上述xml定义中指定的内部android:title属性?