Android hint hint font size modification, show full
1. There is a problem in the work, that is, the custom EDITTEXT hint hint in the oversized font will be displayed,
2. Then search the Internet for a moment, here to record, share to everyone, here to thank the Great God who wrote this
3. The incoming hint is a spannedstring or spanned type, so you can keep the custom properties of the text
Import android.text.SpannableString;
Import android.text.Spanned;
Import android.text.SpannedString;
Import Android.text.style.AbsoluteSizeSpan;
Import android.app.Activity;
Import Android.widget.EditText;
Import Android.widget.TextView;
EditText EditText=(EditText) Rootview.Findviewbyid(R. ID. ET);Create a new text object that can add properties spannablestring SS=NewSpannablestring("TestString");Create a new Property object, set the size of the text Absolutesizespan=NewAbsolutesizespan(8,True);Attach property to Text SS.Setspan(The,0Ss.Length() ) ; //set Hintedittext.sethint (new spannedstring (Ss) ) ; //Be sure to convert, otherwise the property disappears
But what I'm trying to say is I found the layout file for the custom control
<com.android.xx.xx.recipientseditor
Android:id= "@+id/recipients_editor"
android:hint= "@string/to_hint_ipmsg"
Android:layout_width= "Match_parent"
android:layout_height= "Match_parent"
Android:gravity= "Center_vertical"
Android:inputtype= "TextFilter"
android:textcolorhint= "@color/conv_item_date_subjectr_text"
Android:paddingstart= "16dip"
android:layout_weight= "1"
Android:textcolor= "#000000"
/>
also implemented in the super-large font hint prompt display full effect, but also can follow the random switch font size and change the size of
hint, so I think this is simpler than the previous one to put hint hint font size fixed better.
Android hint prompt font size modification, display full