xml - How to underline text of button in Android? -
i new in android programming.i developing simple app . have button transparent , has icon , text. want underline text of button have not been able this. below xml code:
<button android:id="@+id/park" android:layout_width="wrap_content" android:layout_height="wrap_content" android:drawableleft="@drawable/park" android:text="@string/button_name" android:background="#00000000" android:textcolor="#000000"/>
and string file has:
<resources> <string name="button_name"><u>parking areas</u></string> </resources
this approa ch works in textview not in button.
-any suggestion?
button button = (button) findviewbyid(r.id.park); button.setpaintflags(button.getpaintflags() | paint.underline_text_flag);
Comments
Post a Comment