Как сделать макет прокручиваемым? - PullRequest
1 голос
/ 21 июня 2011

enter image description here

Это форма редактирования в Моем приложении, после кнопки «Simpan Perubahan» осталась одна кнопка.Как сделать мою форму прокручиваемой и сделать последнюю кнопку видимой и кликабельной?

Я не очень разбираюсь в макетах.

код:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical">
      <TextView
        android:text="ID Objek"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"/>
      <EditText
        android:id="@+id/tv_obj_id"
        android:editable="false"
        android:singleLine="true"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"/>
      <TextView
        android:text="Nama Objek"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"/>
      <EditText
        android:id="@+id/tv_obj_nama"
        android:editable="true"
        android:singleLine="true"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"/>
      <TextView
        android:text="Detail Objek"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"/>
      <EditText
        android:id="@+id/tv_obj_det"
        android:editable="true"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"/>
      <TextView
        android:text="Koordinat Objek"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"/>
      <TextView
        android:text="Longitude"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"/>
      <EditText
        android:id="@+id/tv_obj_long"
        android:editable="true"
        android:singleLine="true"
        android:inputType="numberDecimal"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"/>
      <TextView
        android:text="Latitude"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"/>
      <EditText
        android:id="@+id/tv_obj_lat"
        android:editable="true"
        android:singleLine="true"
        android:inputType="numberDecimal"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"/>
      <Button 
        android:id="@+id/btn_obj_submit"
        android:text="Simpan Perubahan"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" />
      <Button 
        android:id="@+id/btn_obj_back"
        android:text="Simpan Perubahan"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" />
</LinearLayout>

Что мне делатьв мой XML-файл?

Ответы [ 2 ]

2 голосов
/ 21 июня 2011

Ваш макет должен выглядеть как

<LinearLayout vertical>
    <ScrollView>
        <LinearLayout vertical>
        ... here are your fields ...
        </LinearLayout>
    </ScrollView>
    <LinearLayout horizontal>
    ... here are your buttons ...
    </LinearLayout>
</LinearLayout>
1 голос
/ 21 июня 2011

Использование компонента ScrollView в xml. пример

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...