Android GridView

當GridView和SrollView嵌套使用時,GridView的高度就會產生問題,能夠經過繼承GridView,重寫spa

protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) 方法,如code

protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int expandSpec = MeasureSpec.makeMeasureSpec(
                Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
        super.onMeasure(widthMeasureSpec, expandSpec);
}
相關文章
相關標籤/搜索