【问题标题】:Nine-patch bitmap does not show up九块位图不显示
【发布时间】:2012-10-09 22:41:25
【问题描述】:

我使用 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>

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

请参阅:我在一个仅显示上述子布局的测试项目中对其进行了测试。显示背景。这是我遇到的

【问题讨论】:

  • 什么是 0.9?你指的是九个补丁位图吗?
  • 反正我已经更新了标题。

标签: android android-layout layout button expandablelistview


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多