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

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

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

GridView.post介绍

暂无

代码示例

代码示例来源:origin: huburt-Hu/NewbieGuide

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_grid_view);
  final GridView gridView = (GridView) findViewById(R.id.grid_view);
  final SimpleAdapter pictureAdapter = new SimpleAdapter(this, getList(),
      R.layout.picture_item, from, to);
  gridView.setAdapter(pictureAdapter);
  gridView.post(new Runnable() {
    @Override
    public void run() {
      //高亮gridView的第2个子view
      View childAt = gridView.getChildAt(1);
      NewbieGuide.with(GridViewActivity.this)
          .setLabel("grid_view_guide")
          .alwaysShow(true)
          .addGuidePage(GuidePage.newInstance()
              .addHighLight(childAt, HighLight.Shape.RECTANGLE)
              .setEverywhereCancelable(false)
              .setLayoutRes(R.layout.view_guide, R.id.iv))
          .show();
    }
  });
}

代码示例来源:origin: reloZid/android-anuto

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_change_map);
  mAdapter = new MapsAdapter(this, mMapRepository, mHighScores);
  arrow_up = (ImageView) findViewById(R.id.arrow_up);
  arrow_down = (ImageView) findViewById(R.id.arrow_down);
  grid_maps = (GridView) findViewById(R.id.grid_maps);
  grid_maps.setOnItemClickListener(this);
  grid_maps.getViewTreeObserver().addOnScrollChangedListener(this);
  grid_maps.post(new Runnable() {
    @Override
    public void run() {
      updateArrowVisibility();
    }
  });
  grid_maps.setAdapter(mAdapter);
}

相关文章

GridView类方法