Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

9-Patch Button not showing text

I have a 9-patch button with a right drawable and text assigned to the button, when i use a normal image it shows the text, when i use a colour it shows the text, however when i use a 9-patch image it does not show the image.

Here is the code + image;

<Button 
        android:id="@+id/btn_active_timer"
        android:layout_width="300.00dp"
        android:layout_height="38.00dp"
        android:layout_marginLeft="10.00dp"
        android:layout_above="@+id/gui_menu_container"
        android:layout_marginBottom="6.00dp"
        android:background="@drawable/ui_black"

        android:drawableRight="@drawable/ui_arrow_small"
        android:text="Whats the time mr woolf?"
        android:textColor="#FFFFFF"
        android:textSize="15.00dp"
        android:gravity="left|center_vertical"
     />

enter image description here

like image 893
Xavier Avatar asked Aug 26 '26 05:08

Xavier


1 Answers

Look at the padding areas of your 9-patch - they are 1px in size - there can't be any text on this 1 px. My guess is, you confused the padding and stretching areas. Try replacing top/left with bottom/right.

like image 61
whlk Avatar answered Aug 27 '26 20:08

whlk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!