【发布时间】:2017-06-29 10:19:41
【问题描述】:
这是我的列表视图
<ListView
android:id="@+id/productListView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:list="@{page.results}"/>
我收到此错误:
java.lang.RuntimeException:发现数据绑定错误。 ****/ 数据绑定错误 ****msg:在 android.widget.ListView 上找不到参数类型为 java.util.List 的属性“app:list”的设置器。 地点:33:20 - 33:31 ****\数据绑定错误****
这是我的 BindingAdapter
@BindingAdapter({"bind:list"})
public static void bindList(Context context, ListView view, ObservableArrayList<Result> list) {
ProductsAdapter arrayAdapter = new ProductsAdapter(context,list);
view.setAdapter(arrayAdapter);
}
有人可以帮忙解决这个问题吗?
【问题讨论】:
标签: android listview android-databinding