4

たとえば、アプリケーションPlumeで、ListViewアイテム(ツイート)をクリックすると、その下に展開され、いくつかのアクション(返信、リンク、リツイートなど)が表示されます。アプリケーションでこの動作を再現するにはどうすればよいですか?ListViewアイテムをクリックしてから、(選択したアイテムに対して)自分のアクションで「展開」できるようにしたい。

スクリーンショットの例:

ここに画像の説明を入力してください

ここで使用されているUIデザインパターンは何ですか?

4

2 に答える 2

3

自分で作成する必要があります。拡張するカスタムアダプタを作成しBaseExpandableListAdaptergetChildViewボタンを水平に配置LinearLayoutし、使用するアイコンで'TextViewsを設定する必要があります。TextViewandroid:drawableTop

このレイアウトの非常に簡単な使用法:

<LinearLayout 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <TextView
            android:id="@+id/replyText"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_margin="5dp"
            android:text="@string/app_name"
            android:drawableTop="@drawable/ic_launcher" />
        <TextView
            android:id="@+id/someText"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/app_name"
            android:layout_margin="5dp"
            android:drawableTop="@drawable/ic_launcher" />
        <TextView
            android:id="@+id/otherText"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="5dp"
            android:text="@string/app_name"
            android:drawableTop="@drawable/ic_launcher" />

</LinearLayout>

ドローアブルと文字列を使用できます。それは単なるアプローチです。

于 2013-01-06T20:39:19.853 に答える
1

Plumeがこのライブラリを使用しているかどうかはわかりませんが、Androidを使用して成功しました-この機能のためのSlideExplandableListView 。

https://github.com/tjerkw/Android-SlideExpandableListView

于 2013-01-06T23:03:54.943 に答える