AndroID 中ScrollVIEw与ListVIEw冲突问题的解决办法
自定义MyListVIEw
public class MyListVIEw extends ListVIEw { public MyListVIEw(Context context) { super(context); // Todo @R_502_6843@-generated constructor stub } public MyListVIEw(Context context,AttributeSet attrs) { super(context,attrs); // Todo @R_502_6843@-generated constructor stub } public MyListVIEw(Context context,AttributeSet attrs,int defStyle) { super(context,attrs,defStyle); // Todo @R_502_6843@-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冲突问题的解决办法全部内容,希望文章能够帮你解决Android 中ScrollView与ListView冲突问题的解决办法所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)