Android 在图形布局上延伸的布局项

Android 在图形布局上延伸的布局项,android,xml,user-interface,Android,Xml,User Interface,我正在我的应用程序上设置一个基本数据输入表单,但是我在布局上遇到了困难 这是图形布局的结果。它看起来不错,但所有的项目都超出了手机图形布局的边界。结果,按钮中的文本消失了,微调器看起来拉长了,不专业 以下是XML代码: <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_wi

我正在我的应用程序上设置一个基本数据输入表单,但是我在布局上遇到了困难

这是图形布局的结果。它看起来不错,但所有的项目都超出了手机图形布局的边界。结果,按钮中的文本消失了,微调器看起来拉长了,不专业

以下是XML代码:

<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="5dp"
android:background="#F3F3F3"
android:stretchColumns="1" >

<TableRow>
    <TextView
        android:text="@string/name"
        android:id="@+id/TextView03"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="#333">
    </TextView>

    <EditText
        style="@style/CustomText"
        android:text=""        
        android:id="@+id/nameContent"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:hint="@string/nameHint"
        android:layout_marginBottom="10dp">
    </EditText>
    <!-- CUSTOM STYLES TO BE IMPLEMENTED FRIDAY! -->

</TableRow>

<TableRow>
    <TextView
        android:text="@string/type"
        android:id="@+id/TextView05"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="#333">
    </TextView>

    <Spinner
        android:id="@+id/type_spinner"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="10dp"
        android:layout_marginLeft="-5dp"
        android:background="@android:drawable/btn_dropdown"
        android:padding="5dp" />

</TableRow>

<TableRow>
    <TextView
        android:text="@string/description"
        android:id="@+id/TextView04"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="#333">
    </TextView>

    <EditText
        android:text=""
        android:id="@+id/descriptionContent"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:inputType="textMultiLine"
        android:background="#FFF"
        android:textSize="12dp"
        android:layout_marginBottom="10dp"
        android:padding="5dp"
        android:lines="5"
        android:hint="@string/descriptionHint">     
    </EditText>
</TableRow>

<TableRow>
      <TextView
        android:text="@string/project"
        android:id="@+id/TextView06"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="#333">
    </TextView>

    <Spinner
        android:id="@+id/type_project"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@android:drawable/btn_dropdown"
        android:layout_marginLeft="-5dp"
        android:layout_marginBottom="10dp"
        android:padding="5dp"/>

</TableRow>

<TableRow>
<Button
    android:id="@+id/btnClear"
    android:layout_width="match_parent"
    android:layout_height="30dp"
    android:layout_marginBottom="10dp"
    android:background="#ADD6AD"
    android:text="@string/reset"
    android:drawableLeft="@drawable/ic_discard"
    android:textColor="#333"
    android:textSize="12dp"
    /> 

<Button
    android:id="@+id/btnSync"
    android:layout_width="match_parent"
    android:layout_height="30dp"
    android:layout_marginBottom="10dp"
    android:layout_marginLeft="10dp"
    android:background="#ADD6AD"
    android:drawableLeft="@drawable/ic_save"
    android:text="@string/sync"
    android:textColor="#333" />
  </TableRow> 
 </TableLayout>`

`

有人知道如何纠正这个错误吗?我希望所有内容都在手机预览的范围内。

您的编码在我的模拟器中运行良好,或者根本没有扩展?它在模拟器中工作得很好,只是超出了它的边界。功能性很好!