用 拓展的listView ,可能更好,demo 网上一大把,只要肯去搜索.

解决方案 »

  1.   

    重写ListView的onMeasure方法,大概这个样子:public class MyListView extends ListView {
        public MyListView(Context context, AttributeSet attrs) {
            super(context, attrs);
        }    @Override
        protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
            int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
            super.onMeasure(widthMeasureSpec, expandSpec);
        }

    }然后就和普通ListView一样使用就好了,只是不要太大的数据量或者图片在里面,容易OOM