android - Accessing style items by style ID -
any view have constructor public view (context context, attributeset attrs, int defstyle)
called when view
declared style attribute. so, if have class inherited view
class, can access declared attributes (like android:layout_width
or android:background
) via attributeset
attrs in constructor. when move attributes style cannot see attributes , values exists in style. want read items declared in style have style id in defstyle
parameter. there way read style items using style id?
changing style after creating view not supported .. can :
1 - create new android xml file of type values 2 - add new theme 3 - add elements theme , values , save file
now when dynamically creating new view call constructor allow define defstyle .. point style id have created pointing r."the xml file name"."your style id"
Comments
Post a Comment