Issue
I've seen an empty class named attr inside my autogenerated R.java class; what is its meaning? I know that styles can be defined in style.xml
with style tag, so I don't know what attr is?
Solution
R.attr is for "theme attributes" (not styles).
They're defined in a values xml file like this:
<attr name="textAppearanceLarge" format="reference" />
They're used in View contructors for the defStyle parameter, as in:
public TextView (Context context, AttributeSet attrs, int defStyle)
I'd imagine it's pretty rare for apps to add their own attr values. Usually the ones in android.R.attr will be used if at all.
Answered By - oli
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.