1

拡張可能なリストビューと、リストビューにアイコンを追加する方法があります。どんな体でもこれを助けてください。

ありがとう、ラージ

4

1 に答える 1

0

最初に、展開可能なリスト ビューについてアプリ用に作成した簡単なコードを表示する必要があります。それでも、子と親のレイアウト用に個別の XMLS を作成したと仮定しています。

親レイアウトの例用に別の xlm を作成します。

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" 
android:background="@color/activity_main_bg">


<Imageview
        android:id="@+id/img_thumb
        android:layout_width="match_parent"
        android:layout_height="odp"
        android:


<TextView 
    android:id="@+id/ch1_group"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:paddingLeft="?android:attr/expandableListPreferredItemPaddingLeft"
    android:textSize="23sp"
    android:textColor="@color/black"
    android:background="@drawable/backg"
    />

上記と同じxmlを作成できる子要素に画像を入れたいとします。

次に、アダプターを使用して値を設定します。あなたのケースではうまくいかないかもしれないので、あなたの要件として作成しようとするコードをコピーしないでください.

このリンクは、おそらく詳細を理解するのに役立ちます。

http://www.androidhive.info/2013/07/android-expandable-list-view-tutorial/

于 2013-10-14T21:17:58.643 に答える