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

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -