Android Edittext未填充父对象
因此,我试图使用我的片段的表格布局制作一本带有提交按钮的教科书,但问题是教科书正在变成按钮大小。它没有填充宽度Android Edittext未填充父对象,android,xml,styles,Android,Xml,Styles,因此,我试图使用我的片段的表格布局制作一本带有提交按钮的教科书,但问题是教科书正在变成按钮大小。它没有填充宽度 <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill
<?xml version="1.0" encoding="utf-8"?>
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TableRow
android:id="@+id/tableRow1"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<EditText
android:id="@+id/editText1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textUri" />
</TableRow>
<TableRow
android:id="@+id/tableRow3"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<Button
android:id="@+id/button_as"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="As" />
</TableRow>
</TableLayout>
我做错了什么?当前,整个列的宽度由后续按钮的宽度定义。这是因为该按钮在列中最宽 在
TableLayout
元素中,您希望通过声明android:stretchColumns
将第一列(索引0)标记为可拉伸
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
android:stretchColumns="0">