自定义ListView,xml布局文件中使用该自定义的ListView

public class NoScrollListview extends ListView{

        public NoScrollListview(Context context, AttributeSet attrs) {
                super(context, attrs);
        }
        
        /**
         * 设置不滚动
         */
        public void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
        {
                int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
                                MeasureSpec.AT_MOST);
                super.onMeasure(widthMeasureSpec, expandSpec);
        }
}

  

相关文章:

  • 2021-12-05
  • 2021-12-05
  • 2021-12-05
  • 2021-12-05
  • 2021-10-16
  • 2021-12-05
  • 2021-12-05
  • 2021-11-28
猜你喜欢
  • 2021-12-05
  • 2021-12-05
  • 2021-12-05
  • 2021-12-05
  • 2021-12-05
  • 2021-12-05
  • 2021-12-05
  • 2021-12-05
相关资源
相似解决方案