我已为我的某个 Activity 定义了以下布局:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout android:id="@+id/TableLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android">
<TableRow android:id="@+id/TableRow01" android:layout_height="wrap_content" android:layout_width="fill_parent">
<EditText android:text="Resource Name" android:id="@+id/ResourceName" android:lines="1" android:isScrollContainer="false"></EditText>
</TableRow>
<TableRow android:id="@+id/TableRow02" android:layout_height="wrap_content" android:layout_width="fill_parent">
<Button android:id="@+id/Tile" android:text="Tile"></Button>
</TableRow>
</TableLayout>
我的布局基本正确,唯一的问题是我的文本框和按钮没有占据它们各自行的整个宽度。
我尝试为布局宽度属性指定fill_parent
,但是无济于事,它们仍然只占据大约一半的屏幕。
Android的文档总体来说非常好,但像这样的情况还有一些我遇到了看不见的障碍!感谢所有的帮助!