8

よくある問題だと思いますが、残念ながら見つけられませんでした。

各カードが特定のデータにバインドされ、各カードがその親に関するメタまたは詳細データを示すリストを内部に持つように、カードビューのリストが必要です。

したがって、カードビュー内にネストされたリストがあります。

簡単な検索で、親アイテムが cardview である展開されたリスト ビューを使用する必要があり、その子には別のレイアウトが必要であることがわかります。

したがって、カードをクリックすると、アイテムのリストがルートのカードの下に表示されます。しかし、カード内に子リストを表示したいですか?

また、遷移アニメーションやレイアウトの変更を参照するための子リストIDなどへのアクセスはありません。

明確な質問は、カードビュー内にリストビューを追加する方法ですか?

tablelayout と table row を使用して作業を進めています。安定性とバージョンの問題のために外部ライブラリを使用しないことを好みます。これが私の言いたいことです。

私の質問を説明する画像

私の質問を説明する画像

4

2 に答える 2

0

ExpandLayoutを使用して、それを に追加できますcardview

<com.kyo.expandablelayout.ExpandableLayout
        android:id="@+id/expandlayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="12dp" >

        <ImageView
            android:id="@+id/imageview"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:contentDescription="@null"
            android:scaleType="centerCrop"
            android:src="@drawable/parent" />

        <ImageView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="6dp"
            android:contentDescription="@null"
            android:scaleType="centerCrop"
            android:src="@drawable/child"
            app:canExpand="true" />
    </com.kyo.expandable.ExpandableLayout>
于 2016-07-07T03:51:03.720 に答える