Android ScrollView嵌套SwipeMenuListView冲突解决

解决方法:

SwipeMenuListView添加onMeasure,解决ListView高度问题:

@Override

protected void onMeasure(intwidthMeasureSpec,intheightMeasureSpec) {

intexpandSpec=MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE>>2,MeasureSpec.AT_MOST);

super.onMeasure(widthMeasureSpec,expandSpec);

}


解决冲突:

sl_view.setOnTouchListener(newView.OnTouchListener() {

@Override

public booleanonTouch(Viewv,MotionEventevent) {

lvComment.dispatchTouchEvent(event);//分发事件(让listview滚动)

return false;//scrollview自我滚动,true时不滚动

}

});

你可能感兴趣的:(Android ScrollView嵌套SwipeMenuListView冲突解决)