java - My custom textview too long when call in xml layout -


i created custom textview use custom font folder assets, class writed :

    public class textviewbold extends textview {     private void init()     {         typeface face = typeface.createfromasset(getcontext().getassets(),"fonts/droid-sans.bold.ttf");         settypeface(face);         settextsize(14);         settextcolor(getcontext().getresources().getcolor(r.color.black));     }         public textviewbold(context context)     {         super(context);         init();     }      public textviewbold(context context, attributeset attrs)     {         super(context, attrs);         init();     }  } 

i create 2 other class extends textview call in xml layout :

<com.cmc.xcharge.widget.textviewbold     android:layout_width="fill_parent"     android:layout_height="wrap_content"     android:background="#ff00ff"     android:text="hello" /> 

i build , run success, line: com.cmc.xcharge.widget.textviewbold long use , want use :

<textviewbold      /> 

what should do?


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -

php - Accessing static methods using newly created $obj or using class Name -