解决GridView第一个Item不显示的问题
@Override
public View getView(int i, View view, ViewGroup viewGroup) {
ViewHolder viewHolder = null;
if (null == view) {
viewHolder = new ViewHolder();
view = mLayoutInflater.inflate(R.layout.grid_image_resultlayout, null);
......
view.setTag(viewHolder);
//解决GridView第一个Item不显示的问题
RelativeLayout.LayoutParams newlayoutpa = new RelativeLayout.LayoutParams(this.mWidth, this.mWidth);
view.setLayoutParams(newlayoutpa);
} else {
viewHolder = (ViewHolder) view.getTag();
}
return view;
}
网友评论