我正在我的应用上设置一个基本的数据输入表单,但我的布局有问题。
这是图形布局的结果。它看起来不错,但所有项目都在电话图形布局的边界上伸展得很好。结果,按钮上的文字消失了,旋转器看起来很拉伸,不专业。
以下是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>`
任何人都知道如何解决此错误?我希望一切都能保持在手机预览的范围内。