我有一個listView。我需要每個列表項目的自定義視圖,所以我創建了一個自定義的ListAdapter,它給出了視圖,下面給出了佈局。但是,如何使用RemoteViews將此ListAdapter設置到小部件中的ListView?如何設置自定義ListAdapter在appwidget中列出視圖?
<?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"
android:background="@android:color/background_light"
android:layout_margin="1sp"
android:padding="10sp"
>
<TextView
android:id="@+id/widgetInfo1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/listItemDummy"
android:textColor="@android:color/black"
/>
<TextView
android:id="@+id/widgetInfo2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/listItemDummy"
android:textColor="@android:color/black"
/>
</LinearLayout>
你想要一個列表適配器爲這個列表視圖或你想要一個遠程視圖?你還試過了什麼? – lokoko 2013-02-09 06:06:27
我想將ListView添加到具有自定義視圖項目的窗口小部件。這是我的基本要求,所以我創建了一個listAdapter,但它似乎不能使用正常的listAdapter並將其添加到ListView中的小部件中。以上佈局適用於列表中的單個視圖項目... – Amol 2013-02-09 07:09:32