我有一個相當簡單的xml文件,它有一個圖像按鈕。該圖像在圖形佈局xml設計器上顯示得很好,運行開發版本時顯示正常,但只要創建簽名的apk文件並運行它,圖像就不再顯示。這只是一個空的按鈕。我想不出爲什麼,有什麼想法?該XML文件是這樣的:Android:Drawable not showing up
<?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" >
</TextView>
<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" >
</SeekBar>
<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" >
</ImageButton>
<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>
<Button
android:id="@+id/navigation_cancel_button"
android:layout_width="75dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@string/cancel" >
</Button>
</LinearLayout>
圖像0是一個相當小的(41 * 41),png文件是在res /繪製的文件夾。
我不想將它放在特定的屏幕密度文件夾中,因爲我希望所有設備都能夠在不復印的情況下使用圖像。動態設置圖像不會改變任何內容,它仍然不會在簽名構建中顯示出來。謝謝你嘗試Luk。 – odiggity