android - Remove text padding in Button view -
i remove padding around text in button view. first screenshot result achieve, , second 1 state of art.
of course, have defined custom drawable button appearance. if set padding attribute 0dp result not change.
any suggestion, please?
edit here xml code of button
<button android:id="@+id/btncancel" style="@style/dark_header_button" android:layout_width="wrap_content" android:layout_marginleft="10dp" android:layout_height="wrap_content" android:includefontpadding="false" android:padding="0dp" android:layout_alignparentleft="true" android:layout_centervertical="true" android:text="@android:string/cancel" />
here style xml file:
<style name="dark_header_button"> <item name="android:background">@drawable/bkg_dark_header_button</item> <item name="android:shadowdy">-1</item> <item name="android:shadowcolor">#000000</item> <item name="android:shadowradius">1</item> <item name="android:textsize">14sp</item> <item name="android:textcolor">#ffffff</item> </style>
and here drawable xml file:
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true"> <shape> <corners android:radius="10dp" /> <gradient android:angle="90" android:endcolor="#060606" android:startcolor="#707070" android:type="linear" /> </shape> </item> <item> <shape> <corners android:radius="10dp" /> <gradient android:angle="90" android:endcolor="#707070" android:startcolor="#060606" android:type="linear" /> <stroke android:width="0.5dp" android:color="#2b2b2b" /> </shape> </item> </selector>
button text doesn't need padding, default in center of button. think using android:theme="@android:style/theme.black.notitlebar"
in manifest file, please remove , use native app theme , try it.
Comments
Post a Comment