RecyclerView 输出的和排版的不一样
遇到过这样一种情况,就是RecyclerView加载出来的和看到Android Studio里的不一样
原因是:
@Override public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.message_main_notice_list,parent,false); final ViewHolder holder = new ViewHolder(view); return holder; }
如果写的是下面的情况的时候就会出现问题:
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.message_main_notice_list,null);