ListViewコンポーネントにネストされたGridView(GridViewの高さを再計算)
カスタムGridview:
import android.content.Context;
import android.util.AttributeSet;
import android.widget.GridView;
/**
* GridView
*
* Created by Karen Chia on 2019/4/1.
*
* @author Karen
*/
public class CustomGridView extends GridView {
public FloorHouseNumberGridView(Context context) {
super(context);
}
public FloorHouseNumberGridView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public FloorHouseNumberGridView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
/**
* ( GridView )
*/
@Override
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
MeasureSpec.AT_MOST);
super.onMeasure(widthMeasureSpec, expandSpec);
}
}