libertycode

ListView:

只要重写ListView或GridView的onMeasure()方法即可:

@Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int expendSpec=MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE>>2,MeasureSpec.AT_MOST);
        super.onMeasure(widthMeasureSpec, expendSpec);
    }

注意:有时候会出现打开嵌套ListView的ScrollView的页面默认起始位置不在顶部的情况,这种情况有两种解决方案:

  (1)list.setFocusable(false);

  (2)scrollView.smoothScrollTo(0,0);

RecyclerView:

对于RecyclerView,网上找到了一个方法,但是效果并不好,滑动不够流畅,先记在这里,日后再研究:

 http://blog.csdn.net/u010623588/article/details/50262367

分类:

技术点:

相关文章:

  • 2022-01-21
  • 2021-12-23
  • 2021-12-05
  • 2021-12-05
  • 2021-07-24
  • 2021-06-13
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-05
  • 2021-12-05
  • 2021-12-05
相关资源
相似解决方案