ExpandableListView在ScrollView显示不全的
解决办法有两种
第一种是在ScrollView的控件中添加
android:fillViewport="true" 这属性 但是添加这属性的不好的地方就是不能滑动了
第二种解决办法就是自定义view
/**
* Created by Xk
* on 2019/5/31
* 860618071
*/
public class SuperExpandableListView extends ExpandableListView {
public SuperExpandableListView(Context context) {
super(context);
}
public SuperExpandableListView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public SuperExpandableListView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
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);
}
}