CartExpanableListview自适应有多少数据就多长

来源:互联网 发布:js给a标签添加属性值 编辑:程序博客网 时间:2024/04/28 00:30
public class CartExpanableListview extends ExpandableListView {    public CartExpanableListview(Context context) {        super(context);    }    public CartExpanableListview(Context context, AttributeSet attrs) {        super(context, attrs);    }    public CartExpanableListview(Context context, AttributeSet attrs, int defStyleAttr) {        super(context, attrs, defStyleAttr);    }    @Override    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {        int height = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE>>2,MeasureSpec.AT_MOST);        super.onMeasure(widthMeasureSpec, height);    }}