扫码关注官方订阅号
学习是最好的投资!
首先有点不明白的位置,这个界面为什么会嵌套listView,我觉得一个listView就可以了啦在listView嵌套的时候,一般是写一个自定义类继承ListView,然后重写onMeasure方法 @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST); super.onMeasure(widthMeasureSpec, expandSpec);
}然后把被嵌套的listView改成这个控件就好了,不过这样虽然简单粗暴,但是效率不怎么好,能不嵌套的时候尽量不要嵌套
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
首先有点不明白的位置,这个界面为什么会嵌套listView,我觉得一个listView就可以了啦
在listView嵌套的时候,一般是写一个自定义类继承ListView,然后重写onMeasure方法
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
}
然后把被嵌套的listView改成这个控件就好了,不过这样虽然简单粗暴,但是效率不怎么好,能不嵌套的时候尽量不要嵌套