我正在尝试构建一个简单的表单,我想在顶部添加一个注释/标题/标题,以显示一条消息。我尝试过这样做,但文本已从屏幕上消失,并且其下方的内容也已被推开。我该如何反击?
这是我的layout.xml
,它在 pastebin 上:http: //pastebin.com/fNBfQiz8
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:shrinkColumns="1"
android:stretchColumns="1" >
<TableRow
android:layout_marginBottom="2sp"
android:layout_marginTop="2sp"
android:layout_width="match_parent" >
<TextView
android:layout_width="match_parent"
android:text="You can only add a spot based on your current location" />
</TableRow>
<TableRow
android:layout_marginBottom="2sp"
android:layout_marginTop="2sp" >
<TextView android:text="Name:" />
<EditText android:id="@+id/name" />
</TableRow>
<TableRow
android:layout_marginBottom="2sp"
android:layout_marginTop="2sp" >
<TextView android:text="Address:" />
<EditText android:id="@+id/addr" />
</TableRow>
<TableRow
android:layout_marginBottom="2sp"
android:layout_marginTop="2sp" >
<TextView android:text="Type:" />
<Spinner
android:id="@+id/spinnerType"
style="@style/AppBaseTheme"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:entries="@array/types_array"
android:prompt="@string/types_prompt" />
</TableRow>
<TableRow
android:layout_marginBottom="2sp"
android:layout_marginTop="2sp" >
<TextView android:text="Terrain:" />
<Spinner
android:id="@+id/spinnerTerrain"
style="@style/AppBaseTheme"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:entries="@array/ratings_array"
android:prompt="@string/ratings_prompt" />
</TableRow>
<TableRow>
<TextView android:text="Difficulty:" />
<Spinner
android:id="@+id/spinnerDifficulty"
style="@style/AppBaseTheme"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:entries="@array/ratings_array"
android:prompt="@string/ratings_prompt" />
</TableRow>
<TableRow
android:layout_marginBottom="2sp"
android:layout_marginTop="2sp" >
<TextView android:text="Description:" />
<EditText
android:id="@+id/desc"
android:gravity="top"
android:inputType="textMultiLine"
android:lines="2"
android:maxLines="2"
android:scrollHorizontally="false" />
</TableRow>
<Button
android:id="@+id/save"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Save"
android:layout_marginBottom="2sp"
android:layout_marginTop="2sp" />
</TableLayout>