Android中ScrollView与ListView冲突问题的解决办法

Android 中ScrollView与ListView冲突问题的解决办法

创新互联建站技术团队十年来致力于为客户提供做网站、成都做网站、品牌网站设计成都营销网站建设、搜索引擎SEO优化等服务。经过多年发展,公司拥有经验丰富的技术团队,先后服务、推广了上1000家网站,包括各类中小企业、企事单位、高校等机构单位。

自定义MyListView

public class MyListView extends ListView 
{ 
  public MyListView(Context context) 
  { 
    super(context); 
    // TODO Auto-generated constructor stub 
  } 
 
  public MyListView(Context context, AttributeSet attrs) 
  { 
    super(context, attrs); 
    // TODO Auto-generated constructor stub 
  } 
 
  public MyListView(Context context, AttributeSet attrs, int defStyle) 
  { 
    super(context, attrs, defStyle); 
    // TODO Auto-generated constructor stub 
  } 
 
  protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) 
  { 
    int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST); 
    super.onMeasure(widthMeasureSpec, expandSpec); 
  } 
} 

在xml布局中直接用MyListView替换ListView即可使用

如有疑问请留言或者到本站社区交流讨论,感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!


网站栏目:Android中ScrollView与ListView冲突问题的解决办法
文章出自:http://lszwz.com/article/ggcoci.html

其他资讯

售后响应及时

7×24小时客服热线

数据备份

更安全、更高效、更稳定

价格公道精准

项目经理精准报价不弄虚作假

合作无风险

重合同讲信誉,无效全额退款