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

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

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

GridView.getHeight介绍

暂无

代码示例

代码示例来源:origin: wangdan/AisenWeiBo

expandDir = false;
alphaPvh = PropertyValuesHolder.ofFloat(View.ALPHA, 0.6f, 0.0f);
yPvh = PropertyValuesHolder.ofFloat(View.TRANSLATION_Y, 0, getRefreshView().getHeight());
yPvh = PropertyValuesHolder.ofFloat(View.TRANSLATION_Y, getRefreshView().getHeight(), 0);

代码示例来源:origin: stackoverflow.com

public class MyAdapter extends BaseAdapter {
   GridView mGv;   
 public static int ROW_NUMBER = 5;
   public MyAdapter (GridView gv, Context mContext, ArrayList<String> list) {
   this.context = mContext;
   this.mGv = gv;
   lstDate = list;
 }
   @Override
 public View getView(int position, View convertView, ViewGroup parent) {
   convertView = LayoutInflater.from(context).inflate(R.layout.item, null);
   AbsListView.LayoutParams param = new AbsListView.LayoutParams(
       android.view.ViewGroup.LayoutParams.FILL_PARENT,
       mGv.getHeight()/ROW_NUMBER);
   convertView.setLayoutParams(param);
   return convertView;
 }

代码示例来源:origin: stackoverflow.com

private void resizeGridView(GridView gridView, int items, int columns) {
  ViewGroup.LayoutParams params = gridView.getLayoutParams();
  int oneRowHeight = gridView.getHeight();
  int rows = (int) (items / columns);
  params.height = oneRowHeight * rows;
  gridView.setLayoutParams(params);
}

代码示例来源:origin: stackoverflow.com

private void resizeGridView(GridView gridView, int items, int columns) {
  ViewGroup.LayoutParams params = gridView.getLayoutParams();
  int oneRowHeight = gridView.getHeight();
  int rows = (int) (items / columns);
  params.height = oneRowHeight * rows;
  gridView.setLayoutParams(params);
}

代码示例来源:origin: stackoverflow.com

ghight = gridview1.getHeight();
  try {
imagesearch(wordfromprev);

代码示例来源:origin: zxfnicholas/CameraSDK

@Override @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
  public void onGlobalLayout() {
    final int width = mGridView.getWidth();
    final int height = mGridView.getHeight();
    // mGridWidth = width;
    // mGridHeight = height;
    final int desireSize = getResources().getDimensionPixelOffset(R.dimen.image_size);
    final int numCount = width / desireSize;
    final int columnSpace = getResources().getDimensionPixelOffset(R.dimen.space_size);
    int columnWidth = (width - columnSpace*(numCount-1)) / numCount;
    mImageAdapter.setItemSize(columnWidth);
    if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN){
      mGridView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
    }else{
      mGridView.getViewTreeObserver().removeGlobalOnLayoutListener(this);
    }
  }
});

代码示例来源:origin: stackoverflow.com

@Override public View getView(final int pos, View convertView, ViewGroup parent) {
  g[pos].setLayoutParams(new GridView.LayoutParams(gv.getWidth(), gv.getHeight()));           
  return g[pos];
  ImageView mIV = new ImageView(Test.this);
  mIV.setBackgroundResource(images[pos]);
  mIV.setLayoutParams(new Gallery.LayoutParams(gv.getWidth(), gv.getHeight()/3));         
  return mIV;

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

private void updateArrowVisibility() {
    if (grid_maps.getChildCount() <= 0) {
      arrow_up.setVisibility(View.INVISIBLE);
      arrow_down.setVisibility(View.INVISIBLE);
      return;
    }

    if (grid_maps.getFirstVisiblePosition() == 0) {
      arrow_up.setVisibility(grid_maps.getChildAt(0).getTop() < -10 ? View.VISIBLE : View.INVISIBLE);
    } else {
      arrow_up.setVisibility(grid_maps.getFirstVisiblePosition() > 0 ? View.VISIBLE : View.INVISIBLE);
    }

    if (grid_maps.getLastVisiblePosition() == mAdapter.getCount() - 1) {
      arrow_down.setVisibility(grid_maps.getChildAt(grid_maps.getChildCount() - 1).getBottom() > grid_maps.getHeight() + 10 ? View.VISIBLE : View.INVISIBLE);
    } else {
      arrow_down.setVisibility(grid_maps.getLastVisiblePosition() < mAdapter.getCount() - 1 ? View.VISIBLE : View.INVISIBLE);
    }
  }
}

代码示例来源:origin: stackoverflow.com

.getHeight()));
return g[pos];
mIV.setBackgroundResource(images[pos]);
mIV.setLayoutParams(new Gallery.LayoutParams(gv.getWidth(), gv
    .getHeight() / 3));
return mIV;

代码示例来源:origin: stackoverflow.com

mGridView.animate().translationY(mGridView.getHeight());

代码示例来源:origin: stackoverflow.com

mCellHeight = mGrid.getHeight()/numberOfRows;
mGrid.setColumnWidth(mCellWidth);
mGrid.setNumColumns(numberOfColumns);

代码示例来源:origin: stackoverflow.com

final int lastViewHeight = lastView.getHeight();
final int lastViewTop = lastView.getTop();
final int lastViewPixelsShowing = mGrid.getHeight() - lastViewTop;
final int extraScroll = lastPos < mGrid.getAdapter().getCount() - 1 ? mExtraScroll : mGrid.getPaddingBottom();

相关文章

GridView类方法