listView显示不出来
看起来特别简单的一个PullToRefreshListView,不知道为什么出不来数据,求解
//这是在一个fragment里面的下拉刷新listview
//java代码
@BindView(R.id.word_pullListView)
PullToRefreshListView listView;
nums = new ArrayList<>();
for (int i = 0; i < 20; i++) {
nums.add(i + "");
}
ArrayAdapter adapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_list_item_1, android.R.id.text1, nums);
listView.setAdapter(adapter);
//布局代码
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:background="@color/color_blue"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.handmark.pulltorefresh.library.PullToRefreshListView
android:id="@+id/word_pullListView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
这里我设置了蓝色背景,但是出来的效果是什么都没有.