【发布时间】:2011-11-29 19:24:16
【问题描述】:
我的应用程序有一些布局问题。 这是我的应用程序布局:
<?xml version="1.0" encoding="utf-8"?>
<ImageView android:layout_width="fill_parent" android:layout_height="wrap_content"
android:src="@drawable/tax_calculator_logo"/>
<LinearLayout android:layout_height="fill_parent" android:layout_width="fill_parent"
android:orientation="vertical" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_gravity="center"
android:layout_marginTop="10dp" android:layout_marginBottom="10dp">
<Button android:id="@+id/contactUs" android:layout_height="wrap_content"
android:layout_width="fill_parent" android:text="Contact Us"
android:textSize="20dp"/>
<Button android:id="@+id/contactUs" android:layout_height="wrap_content"
android:layout_width="fill_parent" android:text="Contact Us"
android:textSize="20dp"/>
<Button android:id="@+id/contactUs" android:layout_height="wrap_content"
android:layout_width="fill_parent" android:text="Contact Us"
android:textSize="20dp"/>
<Button android:id="@+id/contactUs" android:layout_height="wrap_content"
android:layout_width="fill_parent" android:text="Contact Us"
android:textSize="20dp"/>
</LinearLayout>
在这里,我想将所有按钮设置为完全适合任何设备的屏幕高度。 是的,我可以显示所有按钮。但我希望它们之间的空间相等,并且它们必须完全适合屏幕高度。 那我该怎么办呢?
已编辑:
还有,我的 tax_calculator_logo 的分辨率为 600x239,我已将 ImageView 的高度设置为 wrap_content 和宽度,使用 fill_parent 那么为什么图像从底部和顶部裁剪???
【问题讨论】:
标签: android android-layout android-emulator android-widget