0

アクティビティ ビューにスクロール ビューがあります。このレイアウトでは、別のレイアウトをループで膨張させることにより、「ucontent」、「pcontent」に動的コンテンツを追加します (膨張したレイアウトの数は時間とともに変化します)。スクロール ビューをスクロールする必要があります。 「titlep」をクリックすると、「titlep」の付いたタイトルが一番上に来るようにします。

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/sv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#232323"
android:scrollbars="none" >

<LinearLayout
    android:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="fill_parent"
    android:background="#232323"
    android:orientation="vertical" >

    <LinearLayout
        android:id="@+id/titleu"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#D84A49"
        android:orientation="horizontal"
        android:paddingBottom="7dp"
        android:paddingTop="7dp" >

        <ImageView
            android:id="@+id/toggleu"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_marginLeft="2dp"
            android:src="@drawable/toggleu" />

        <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:text="title1....."
            android:textColor="#ffffff" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/ucontent"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >
    </LinearLayout>

    <LinearLayout
        android:id="@+id/titlep"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"
        android:layout_marginBottom="0dp"
        android:layout_marginTop="5dp"
        android:background="#D84A49"
        android:orientation="horizontal"
        android:paddingBottom="7dp"
        android:paddingTop="7dp" >

        <ImageView
            android:id="@+id/togglep"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_marginLeft="2dp"
            android:src="@drawable/toggleu" />

        <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:layout_weight=".1"
            android:text="title2...."
            android:textColor="#ffffff" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/pcontent"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >
    </LinearLayout>
</LinearLayout>

コードまたはxmlでそれを行うにはどうすればよいですか?

4

1 に答える 1