java - Custom styling of views -
i'm working on survey application dynamically creates textview widgets. i've been trying afternoon, without success, find way encapsulate styling behavior can call .settextappearance(context, *customstyle*), i'm not sure define or how call custom style.
create custom style in xml file in res/values, example res/values/styles.xml:
<resources> <style name="customtextstyle" parent="android:style/textappearance"> <item name="android:textcolor">#f00</item> </style> </resources> then apply style textview in code:
yourtextview.settextappearance(context, r.style.customtextstyle);
Comments
Post a Comment