0
私は、コメントのリストを表示し、より多くのコメントを追加する人のためのテキスト領域を表示するアクティビティを持っています。Android - ページ上の他の要素を使わないスクロール
今のところ、画面の下部に表示されるコメントがいくつかある場合は、テキスト領域に上書きされます。
私は、ページ全体がコメントとテキスト領域と共にスクロール可能な場合には好きです。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/question_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Your question: "
/>
<TextView
android:id="@+id/question"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text=""
/>
<TextView
android:id="@+id/please_wait"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Please wait while the discussion loads..."
/>
<ListView
android:id="@android:id/list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@+id/label"
android:textSize="20px" >
</ListView>
<EditText
android:id="@+id/question_text"
android:layout_height="wrap_content"
android:hint="@string/question_comment_hint"
android:inputType="textMultiLine"
android:lines="5"
android:layout_width="fill_parent">
</EditText>
<Button
android:id="@+id/submit"
android:layout_height="wrap_content"
android:text="@string/submit"
android:onClick="sendFeedback"
android:layout_width="fill_parent">
</Button>
</LinearLayout>
</ScrollView>
</LinearLayout>
ありがとう:
は、ここに私の現在のレイアウトxmlです!
コメントを残すたびに一番下までスクロールしなければならなかったら、私は一人の欲求不満のユーザーになるでしょう:)。 edittextとボタンをスクロールビューの外に置かないと、リストを見ている間にいつでもコメントを追加できます。 – Jack
あなたはスクロールビュー内にリストビューを持つべきではありません。 – dmon
@Jackと合意しました。私は、新しいコメントを入力するためのダイアログを表示する「新しいコメント」オプションであるメニューオプションまたはアクションバーオプション(あなたが構築しているAndroidのバージョンに応じて)を持たなければならないと思います – dymmeh