android 设置gridView item的高度
public View getView(int position, View convertView, ViewGroup parent) { convertView = LayoutInflater.from(context).inflate(R.layout.item, null); AbsListView.LayoutParams param = new AbsListView.LayoutParams( android.view.ViewGroup.LayoutParams.FILL_PARENT, mGv.getHeight()/ROW_NUMBER);//传入自己需要的宽高
convertView.setLayoutParams(param); return convertView; }
本文出自 无忧之路 - 博客园