已采纳回答 / NightfuryN
如下修改试试:mInflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE);View convertView = mInflater.from(mContext).inflate(R.layout.listview_item, parent, false);
2015-10-11
看这个BLOG,解决holder.itemView.getLayoutParams() 得到的LayoutParams为Null
http://blog.csdn.net/lmj623565791/article/details/45059587
http://blog.csdn.net/lmj623565791/article/details/45059587
2015-10-07
10:57 处
public MyViewHolder onCreateViewHolder(ViewGroup arg0, int i) {
View view = mInflater.inflate(R.layout.item_cell,arg0,false);
MyViewHolder viewHolder = new MyViewHolder(arg0);//应改为 MyViewHolder viewHolder = new MyViewHolder(view);
return viewHolder;
}
public MyViewHolder onCreateViewHolder(ViewGroup arg0, int i) {
View view = mInflater.inflate(R.layout.item_cell,arg0,false);
MyViewHolder viewHolder = new MyViewHolder(arg0);//应改为 MyViewHolder viewHolder = new MyViewHolder(view);
return viewHolder;
}
2015-09-25