Android处理scrollciew里嵌套ExpandableListView的滑动事件
16lz
2021-01-23
import android.content.Context;import android.util.AttributeSet;import android.widget.ExpandableListView;/** * 处理scrollciew里嵌套ExpandableListView的滑动事件 * */public class CustomerExpandableListView extends ExpandableListView {public CustomerExpandableListView(Context context) {super(context);// TODO Auto-generated constructor stub}public CustomerExpandableListView(Context context, AttributeSet attrs) {super(context, attrs);}public CustomerExpandableListView(Context context, AttributeSet attrs,int defStyle) {super(context, attrs, defStyle);}/** * 只需要重写这个方法即可 */@Overrideprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,MeasureSpec.AT_MOST);super.onMeasure(widthMeasureSpec, expandSpec);}}
更多相关文章
- 解决ScrollView中嵌套RecyclerVIew产生滑动冲突问题
- Android ScrollView + ListView嵌套使用
- 在屏幕上方是actionBar tab的ViewPager页面里面嵌套子tab并显示
- android:解决 ScrollView嵌套RecyclerView后无法惯性滑动的问题
- Android简单的Fragment嵌套Fragment(Viewpager+Fragement)
- Android ViewPager 中嵌套webview 的滚动处理
- Android中的HashMap原理实践探索,重写equals(),为什么重写hashCode
- android嵌套滑动- Material Design
- Android百分比布局(PercentRelativeLayout)嵌套NavigationView自