RecyclerView match_parent 不起作用的解决方法


1  

@Override
public RecordViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    Log.i(TAG, "onCreateViewHolder: ");
    view = mLayoutInflater.inflate(R.layout.item_check_info, null, false);
    RecyclerView.LayoutParams lp = new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    view.setLayoutParams(lp);
    return new RecordViewHolder(view);
}

你可能感兴趣的:(androidStudio,android技术)