Fragment中listview不正常显示的解决办法

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Snow_Ice_Yang/article/details/82803871

RecyclerView不调用onCreateViewHolder和onBindViewHolder

1.getItemCount()返回值<=0 ;

2.要设置LinearLayoutManager ;

listView = view.findViewById(R.id.lv_communication);
        mLayoutManager = new LinearLayoutManager(getActivity());
        mLayoutManager.setOrientation(OrientationHelper.VERTICAL);
        listView.setLayoutManager(mLayoutManager);

3.被ScrollView嵌套

猜你喜欢

转载自blog.csdn.net/Snow_Ice_Yang/article/details/82803871