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

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嵌套

你可能感兴趣的:(Android,Fragment,ListView)