在 Android 活动中,我想放置一个徽标以水平填充屏幕;
<?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="fill_parent"
android:gravity="center"
android:background="#FF0000"
android:id="@+id/layout"
>
<ImageButton
android:background="#124644"
android:src="@+drawable/androidlogo"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/LogoImage"
>
</ImageButton>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="#FFFFFF"
android:background="#000000"
android:textSize="34sp"
android:gravity="center"
android:typeface="sans"
android:id="@+id/TitleText"
android:text="Some Test"
android:textStyle="bold"
>
</TextView>
</LinearLayout>
在一个小屏幕中,它填充:
但不是在大屏幕中:
我希望设置layout_width
就fill_parent
足够了,但显然不是。我还必须做什么?