我有一个横幅布局。我删除了其余的代码。横幅固定宽度
我将它创建为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