在onCreateView中向recycleView添加数据时,项目被正确包装,但问题是它无法在响应方法中包装数据,这在AsyncTask完成时调用。并且以下方法返回0
recycleView.getLayoutParams().height
AsyncTask 从服务器获取数据后我实现此代码以便在
中响应SafeSecondRootFragment.java
@Override
public void response(String credit) {
setData(credit);
}
public void setData(final Credit credit){
zalogs.add(new Zalog("asd","qwerty","cat",234,32,23));
zalogs.add(new Zalog("asd","qwerty","cat",234,32,23));
zalogs.add(new Zalog("asd","qwerty","cat",
adapter = new SafeDetailsOfItemAdapter(zalogs);
recyclerView.setLayoutManager(layoutManager);
recyclerView.setAdapter(adapter);
}
最后问题是它添加数据但没有包装其内容,我搜索并看起来很多想但没有任何作用,请帮助我。 RecycleView位于ScrollView