您的位置:首页 > 移动开发 > Android开发

完美解决android:ScrollView嵌套ListView的问题 .

2012-09-04 11:26 531 查看
package com.cyol.android.wbxy.mylistview;

import android.content.Context;

import android.util.AttributeSet;

import android.view.View;

import android.widget.ListAdapter;

import android.widget.ListView;

public class MySingListView extends ListView

{

public MySingListView(Context context)

{

super(context);

// TODO Auto-generated constructor stub

}

public MySingListView(Context context, AttributeSet attrs, int defStyle)

{

super(context, attrs, defStyle);

// TODO Auto-generated constructor stub

}

public MySingListView(Context context, AttributeSet attrs)

{

super(context, attrs);

// TODO Auto-generated constructor stub

}

@Override

protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)

{

// TODO Auto-generated method stub

int expandSpec = MeasureSpec.makeMeasureSpec(

Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);

super.onMeasure(widthMeasureSpec, expandSpec);

}

}

<com.test.MySingListView

android:id="@+id/sing_remark_listView"

android:layout_width="fill_parent"

android:layout_height="40.0dip"

android:layout_below="@id/sing_remark_progressBar"

android:scrollbars="none" >

</com.test.MySingListView>

经测试~~这种办法可以完美解决ScrollView嵌套ListView的问题 .
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐