android.widget.GridView.onMeasure()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(251)

本文整理了Java中android.widget.GridView.onMeasure()方法的一些代码示例,展示了GridView.onMeasure()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GridView.onMeasure()方法的具体详情如下:
包路径:android.widget.GridView
类名称:GridView
方法名:onMeasure

GridView.onMeasure介绍

暂无

代码示例

代码示例来源:origin: sunfusheng/StickyHeaderListView

@Override
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
  int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
  super.onMeasure(widthMeasureSpec, expandSpec);
}

代码示例来源:origin: jaydenxiao2016/AndroidFire

@Override
  public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    int expandSpec = MeasureSpec.makeMeasureSpec(
        Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
    super.onMeasure(widthMeasureSpec, expandSpec);
  }
}

代码示例来源:origin: ksoichiro/Android-ObservableScrollView

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
  super.onMeasure(widthMeasureSpec, heightMeasureSpec);
  ListAdapter adapter = getAdapter();
  if (adapter != null && adapter instanceof HeaderViewGridAdapter) {
    ((HeaderViewGridAdapter) adapter).setNumColumns(getNumColumnsCompat());
  }
}

代码示例来源:origin: TonicArtos/StickyGridHeaders

super.onMeasure(widthMeasureSpec, heightMeasureSpec);

代码示例来源:origin: liaohuqiu/android-GridViewWithHeaderAndFooter

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
  super.onMeasure(widthMeasureSpec, heightMeasureSpec);
  ListAdapter adapter = getAdapter();
  if (adapter != null && adapter instanceof HeaderViewGridAdapter) {
    ((HeaderViewGridAdapter) adapter).setNumColumns(getNumColumnsCompatible());
    ((HeaderViewGridAdapter) adapter).setRowHeight(getRowHeight());
  }
}

代码示例来源:origin: UweTrottmann/SeriesGuide

super.onMeasure(widthMeasureSpec, heightMeasureSpec);

代码示例来源:origin: envyfan/AndroidReview

@Override
  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);
  }
}

代码示例来源:origin: smuyyh/SprintNBA

@Override
  public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
    super.onMeasure(widthMeasureSpec, expandSpec);
  }
}

代码示例来源:origin: huntermr/FastAndroid

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
  int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
      MeasureSpec.AT_MOST);
  super.onMeasure(widthMeasureSpec, expandSpec);
}

代码示例来源:origin: huangfangyi/FanXin

@Override
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
  int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
  super.onMeasure(widthMeasureSpec, expandSpec);
}

代码示例来源:origin: Applandeo/Material-Calendar-View

@Override
  public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
        MeasureSpec.AT_MOST);
    super.onMeasure(widthMeasureSpec, expandSpec);
  }
}

代码示例来源:origin: boredream/DesignResCollection

@Override
  protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {

    int heightSpec = MeasureSpec.makeMeasureSpec(
        Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);

    super.onMeasure(widthMeasureSpec, heightSpec);
  }
}

代码示例来源:origin: huangfangyi/YiChat

@Override
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
  int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
  super.onMeasure(widthMeasureSpec, expandSpec);
}

代码示例来源:origin: yaozs/YzsLib

@Override
  protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
        MeasureSpec.AT_MOST);
    super.onMeasure(widthMeasureSpec, expandSpec);
  }
}

代码示例来源:origin: myxh/CoolShopping

@Override
  protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    int expendSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >>2,MeasureSpec.AT_MOST);
    super.onMeasure(widthMeasureSpec, expendSpec);
  }
}

代码示例来源:origin: flyleft/xmarket

@Override
  public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {

    int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
        MeasureSpec.AT_MOST);
    super.onMeasure(widthMeasureSpec, expandSpec);
  }
}

代码示例来源:origin: devinhu/androidone

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
  int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
  super.onMeasure(widthMeasureSpec, expandSpec);
}

代码示例来源:origin: gdpancheng/LoonAndroid3

@Override
  public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {

    int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
    super.onMeasure(widthMeasureSpec, expandSpec);
  }
}

代码示例来源:origin: FreedomZZQ/YouJoin-Android

@Override
  protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    if (getLayoutParams() != null && getLayoutParams().height == LayoutParams.WRAP_CONTENT) {
      // 使GridView支持wrap_content的高度
      // see http://www.jayway.com/2012/10/04/how-to-make-the-height-of-a-gridview-wrap-its-content/
      heightMeasureSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
    }
    super.onMeasure(widthMeasureSpec, heightMeasureSpec);
  }
}

代码示例来源:origin: dingjikerbo/Android-ToolKit

@Override
  protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    super.onMeasure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(MEASURED_SIZE_MASK, MeasureSpec.AT_MOST));
    getLayoutParams().height = getMeasuredHeight();
  }
}

相关文章

GridView类方法