设置Listview不滚动

scrollview和listview的滑动事件会冲突,所以我们设置listview不滚动就可以

public class ExplosiveListView extends ListView {

    public ExplosiveListView(Context context) {
        super(context);
        // TODO Auto-generated constructor stub
    }

    // 设置不滚动
    public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
        super.onMeasure(widthMeasureSpec, expandSpec);

    }

}

 

posted @ 2016-01-13 16:11  aaddrrooiidd  阅读(596)  评论(0编辑  收藏  举报