簡單解決RecyclerView巢狀的RecyclerView條目顯示不全和寬度不能鋪滿
阿新 • • 發佈:2019-01-01
第一個RecyclerView的Adapter
@Override
public MyHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.shop_item,null); 解決條目顯示不全
MyHolder holder = new MyHolder(view);
return holder;
}
第二個RecyclerView的Adapter
@Override public MyHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.check_item, parent,false);//解決寬度不能鋪滿 MyHolder holder = new MyHolder(view); return holder; }