我有一個橫幅佈局。我刪除了其餘的代碼。橫幅固定寬度
我將它創建爲imagebutton。
佈局具有圖像作爲佈局,例如在HDPI,尺寸爲:720x1200像素,並且ImageButton的是720x200
這是的ImageButton:
但imagebutton沒有固定寬度,但我沒有找到錯誤!
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:background="@drawable/background"
>
<ImageButton
android:id="@+id/sabadell_but"
android:background="@null"
android:contentDescription="@string/infoDesc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dip"
android:src="@drawable/banner_sabadell" />
</LinearLayout>
我怎樣才能得到固定寬度的ImageButton?
我得到了同樣的結果 – user1256477 2013-03-19 08:46:29