change Default font for Android App -


okay, know how change font used on individual textboxes in app, want text in app use custom font , color, , way can think of reference each box , set them proper font , color. while it's doable seems rather clunky method, there better way?

you can create custom textview , reffer everywhere.

public class typefacedtextview extends textview {      public typefacedtextview(context context, attributeset attrs) {         super(context, attrs);          typeface typeface = typeface.createfromasset(context.getassets(), fontname);         settypeface(typeface);     } } 

inside view.xml

<packagename.typefacedtextview              android:layout_width="fill_parent"              android:layout_height="wrap_content"              android:text="hello"/> 

Comments

Popular posts from this blog

HTTP/1.0 407 Proxy Authentication Required PHP -

curl - PHP fsockopen help required -

c# - Resource not found error -