【发布时间】:2011-11-20 10:41:29
【问题描述】:
我有一个相当简单的 xml 文件,其中有一个图像按钮。图像在图形布局 xml 设计器上显示良好,在我运行开发构建时显示良好,但是一旦我创建签名的 apk 文件并运行它,图像就不再显示。它只是一个空按钮。我想不出原因,有什么想法吗? xml 文件如下所示:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/navigation_root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="@+id/navigation_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="TextView"
android:textAppearance="?android:attr/textAppearanceLarge" />
<SeekBar
android:id="@+id/navigation_seekbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:padding="5dp" />
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp" >
<ImageButton
android:id="@+id/part_select_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/chapter_select" />
<Button
android:id="@+id/navigation_ok_button"
android:layout_width="75dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@string/ok" />
<Button
android:id="@+id/navigation_cancel_button"
android:layout_width="75dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@string/cancel" />
</LinearLayout>
</LinearLayout>
图像@drawable/chapter_select 是一个相当小的 (41*41) png 文件,位于 res/drawable 文件夹中。
【问题讨论】: