Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/226.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 九面片位图不显示_Android_Android Layout_Layout_Button_Expandablelistview - Fatal编程技术网

Android 九面片位图不显示

Android 九面片位图不显示,android,android-layout,layout,button,expandablelistview,Android,Android Layout,Layout,Button,Expandablelistview,我使用expandablelistview构建了一些功能。expandablelistview的子布局为 <?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"

我使用expandablelistview构建了一些功能。expandablelistview的子布局为

<?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>

问题是按钮的背景无法显示


请看:我在一个只显示上面的子布局的测试项目中测试了它。背景图如下所示。这就是我遇到的问题

我注意到,如果将9-patch保存为带有调色板的PNG,它将不会显示。另存为TrueColor,看看是否有区别。

什么是。9?你在引用九个补丁位图吗?不管怎样,我已经更新了标题。