简单解决RecyclerView嵌套的RecyclerView条
2017-08-11 本文已影响128人
孙科技
简单解决RecyclerView嵌套的RecyclerView条目显示不全和宽度不能铺满
分类:Android
(1521)(2)
第一个RecyclerView的Adapter
[java]view plaincopy
@Override
publicMyHolder onCreateViewHolder(ViewGroup parent,intviewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.shop_item,null); 解决条目显示不全
MyHolder holder =newMyHolder(view);
returnholder;
}
第二个RecyclerView的Adapter
[java]view plaincopy
@Override
publicMyHolder onCreateViewHolder(ViewGroup parent,intviewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.check_item, parent,false);//解决宽度不能铺满
MyHolder holder =newMyHolder(view);
returnholder;
}