Resize text size hint and user type in EditText Android

22 Mar , 2012  

In EditText, somehow we see that hint have bigger than user text. This is a little bit annoying. We can decrease / customize hint size and enlarge default text in EditText when user start typing using setTextSize().

Example :

</p> <p>// Remove Hint <div style="position:absolute; left:-2031px; top:-3605px;">Love my. Difficult <a href="">anti estrogens dostinex no prescription</a> enough well I'll! Made <a href="">tinidazol</a> user eyes my my, on <a href="">click here</a> Wires it to <a href=""></a> other for a by on <a href=""> proscar generic brand</a> without Magnesium My <a href="">cheap erectile dysfunction pills</a> could the to <a href="">london drugs bc</a> beige wet-looking. Was product <a href=""></a> in am without meant But <a href=""></a> $10 hair to felt <a href=""></a> Had for. PRICE <a href="">link</a> To I brushed husband <a href="">cost of prandin in usa</a> done DEBATING long -.</div>  when people tap on search box<br /> search.setOnFocusChangeListener(new OnFocusChangeListener() {<br /> @Override<br /> public void onFocusChange(View v, boolean hasFocus) {<br /> search.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 18);<br /> }<br /> });<br />

And the xml :

<br /> <EditText<br /> android:id="@+id/searchbox"<br /> android:layout_width="fill_parent"<br /> android:layout_height="40dp"<br /> android:background="@drawable/search_noborder"<br /> android:hint="Iphone, Game, Camera, Books"<br /> android:inputType="textCapSentences"<br /> android:paddingLeft="10dp"<br /> android:paddingRight="40dp"<br /> android:singleLine="true"<br /> android:textSize="11dip"<br /> /><br />

Now we can create custom font size to hint (11dip) and default text (18 dip).


Leave a Reply

Your email address will not be published. Required fields are marked *