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; }

 

posted @ 2014-03-03 14:38  无忧之路  阅读(4941)  评论(0编辑  收藏  举报
无忧之路