简体   繁体   中英

Nine-patch bitmap does not show up

I used expandablelistview to build some functionality. The child layout of the expandablelistview is

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="75dp" 
    android:paddingTop="23dp"
    android:paddingBottom="15dp"
    android:paddingLeft="44dp"
    android:paddingRight="44dp"
    android:orientation="horizontal" 
    android:gravity="center_vertical"
    android:background="@drawable/app_expandable_list_child_bg" >

    <Button
        android:id="@+id/app_download_cancel"
        android:layout_width="100dp"
        android:layout_height="37dp"
        android:background="@drawable/app_cancel_detail_button_bg"
        android:layout_weight="1"
        android:layout_marginRight="32dp"
        android:gravity="center"
        android:textColor="#454545"
        android:textSize="13sp"
        android:clickable="true"
        android:focusable="false"
        android:text="@string/app_cancel_downloading" />

    <Button
        android:id="@+id/app_more_info"
        android:layout_width="100dp"
        android:layout_height="37dp"
        android:background="@drawable/app_cancel_button_bg_normal"
        android:gravity="center"
        android:layout_weight="1"
        android:textColor="#454545"
        android:textSize="13sp"
        android:clickable="true"
        android:focusable="false"
        android:text= "@string/app_more_details"/>

</LinearLayout>

The trouble is the background of the button could not show.

Please See : I tested that in a test project that only shows the child layout above. The background is shown. This is what I came across

I've noticed that if you save your 9-patch as a PNG with palette, it does not display. Save as TrueColor, see if makes a difference.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM