public class HeightFixListView extends ListView {
public HeightFixListView(Context context) {
super(context);
}
public HeightFixListView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public HeightFixListView(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);
} //重寫listview高度
}