Android解决RecyclerView嵌套的RecyclerView或CardView条目显示不全和宽度不能铺满

RecyclerView条目显示不全

@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条目宽度不能铺满

@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;  
   }  

你可能感兴趣的:(Android)