binbinyang---关于开发中listview 跟ScrollView 的冲突问题解决办法

来源:互联网 发布:mac版qq没有群视频2016 编辑:程序博客网 时间:2024/06/10 17:08

开发中.界面五花八门.各种各样. 你肯定也遇到了很多组件的冲突问题

今天我说的 是listview------scrollview冲突

首先

/** *  * @author 杨彬 * */public class ListViewForScrollView extends ListView {    public ListViewForScrollView(Context context) {        super(context);    }    public ListViewForScrollView(Context context, AttributeSet attrs) {        super(context, attrs);    }    public ListViewForScrollView(Context context, AttributeSet attrs,        int defStyle) {        super(context, attrs, defStyle);    }            @Override       protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {        int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,        MeasureSpec.AT_MOST);        super.onMeasure(widthMeasureSpec, expandSpec);    }}

然后

 <com.xiekang.e.views.ListViewForScrollView                android:id="@+id/lv_proj_name"                android:layout_width="match_parent"                android:layout_height="400dp"                android:layout_below="@+id/tv_pro_name" >            </com.xiekang.e.views.ListViewForScrollView

 


0 0