网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

AndroidScrollView嵌套ExpandableListView显示不正常的问题的解决办法

Android ScrollView嵌套ExpandableListView显示不正常的问题的解决办法

创新互联公司是一家集做网站、成都网站制作、网站页面设计、网站优化SEO优化为一体的专业网络公司,已为成都等多地近百家企业提供网站建设服务。追求良好的浏览体验,以探求精品塑造与理念升华,设计最适合用户的网站页面。 合作只是第一步,服务才是根本,我们始终坚持讲诚信,负责任的原则,为您进行细心、贴心、认真的服务,与众多客户在蓬勃发展的市场环境中,互促共生。

前言:

   关于ScrollView嵌套ExpandableListView导致ExpandableListView显示不正常的问题解决方法有很多,在这里介绍一种小编亲自测试通过的方法。

重写ExpandableListView:

实例代码:

package com.jph.view; 
 
import android.content.Context; 
import android.util.AttributeSet; 
import android.widget.ExpandableListView; 
 
/** 
 * 重写ExpandableListView以解决ScrollView嵌套ExpandableListView 
 *
导致ExpandableListView显示不正常的问题 * @author jph * Date:2014.10.21 */ public class CustomExpandableListView extends ExpandableListView { public CustomExpandableListView(Context context) { super(context); // TODO Auto-generated constructor stub } public CustomExpandableListView(Context context, AttributeSet attrs) { super(context, attrs); // TODO Auto-generated constructor stub } public CustomExpandableListView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); // TODO Auto-generated constructor stub } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { // TODO Auto-generated method stub int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST); super.onMeasure(widthMeasureSpec, expandSpec); } }

在XML中将ExpandableListView替换为重写的ExpandableListView即可。

 

感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!


新闻名称:AndroidScrollView嵌套ExpandableListView显示不正常的问题的解决办法
转载来于:http://bjjierui.cn/article/pciipo.html

其他资讯