import android.content.Context;
import android.util.AttributeSet;
import android.widget.ListView;
/**
* 重写Listview 解决在scrollview现实不全
*
* @author rjh
*
*/
public class MyListView extends ListView {
public MyListView(Context context) {
// TODO Auto-generated method stub
super(context);
}
public MyListView(Context context, AttributeSet attrs) {
// TODO Auto-generated method stub
super(context, attrs);
}
public MyListView(Context context, AttributeSet attrs, int defStyle) {
// TODO Auto-generated method stub
super(context, attrs, defStyle);
}
@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);
}
}
解决listview 在scrollview 显示不全
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
推荐阅读更多精彩内容
- 一开始在采用网上搜索的方法: 先给listView设置adapter,然后再采用上图的方法,这样就把条目显示出来了...
- 摘要:开发中经常遇到ScrollView嵌套ListView,GridView,或者RecyclerView嵌套R...
- 在之前的开发中(没有recyclerview的时候)有时候会碰到ScrollView和ListView的嵌套使用,...