本文整理了Java中android.widget.GridView.setVerticalSpacing()
方法的一些代码示例,展示了GridView.setVerticalSpacing()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GridView.setVerticalSpacing()
方法的具体详情如下:
包路径:android.widget.GridView
类名称:GridView
方法名:setVerticalSpacing
暂无
代码示例来源:origin: TonicArtos/StickyGridHeaders
@Override
public void setVerticalSpacing(int verticalSpacing) {
super.setVerticalSpacing(verticalSpacing);
mVerticalSpacing = verticalSpacing;
}
代码示例来源:origin: stackoverflow.com
GridView gv = findViewById(R.id.my_grid_view);
gv.setBackgroundColor(Color.WHITE);
gv.setVerticalSpacing(1);
gv.setHorizontalSpacing(1);
代码示例来源:origin: UweTrottmann/SeriesGuide
@Override
public void setVerticalSpacing(int verticalSpacing) {
super.setVerticalSpacing(verticalSpacing);
mVerticalSpacing = verticalSpacing;
}
代码示例来源:origin: Flipboard/bottomsheet
spacing = getResources().getDimensionPixelSize(R.dimen.bottomsheet_image_tile_spacing);
tileGrid.setDrawSelectorOnTop(true);
tileGrid.setVerticalSpacing(spacing);
tileGrid.setHorizontalSpacing(spacing);
tileGrid.setPadding(spacing, 0, spacing, 0);
代码示例来源:origin: p-v/FlexibleCalendar
/**
* Sets the weekview header vertical spacing between weekdays
*
* @param spacing
*/
public void setWeekViewVerticalSpacing(int spacing) {
this.weekdayVerticalSpacing = spacing;
weekDisplayView.setVerticalSpacing(weekdayVerticalSpacing);
}
代码示例来源:origin: qq8585083/DragIcon
@Override
public void setVerticalSpacing(int verticalSpacing) {
mVerticalSpacing = verticalSpacing;
super.setVerticalSpacing(verticalSpacing);
}
代码示例来源:origin: WeAreFairphone/FP2-Launcher
@Override
public void setVerticalSpacing(int spacing)
{
this.verticalSpacing = spacing;
super.setVerticalSpacing(spacing);
}
代码示例来源:origin: AlexMofer/ProjectX
@Override
public void setVerticalSpacing(int verticalSpacing) {
mVerticalSpacing = verticalSpacing;
super.setVerticalSpacing(verticalSpacing);
}
代码示例来源:origin: canqihe/TmallSale
@Override
public void setVerticalSpacing(int verticalSpacing) {
super.setVerticalSpacing(verticalSpacing);
mVerticalSpacing = verticalSpacing;
}
代码示例来源:origin: tdscientist/fluidCalendar
/**
* Sets the weekview header vertical spacing between weekdays
*
* @param spacing
*/
public void setWeekViewVerticalSpacing(int spacing) {
this.weekdayVerticalSpacing = spacing;
weekDisplayView.setVerticalSpacing(weekdayVerticalSpacing);
}
代码示例来源:origin: stackoverflow.com
GridView gv = findViewById(R.id.my_grid_view);
gv.setBackgroundColor(Color.WHITE);
gv.setVerticalSpacing(1);
gv.setHorizontalSpacing(1);
代码示例来源:origin: p-v/FlexibleCalendar
@Override
public Object instantiateItem(ViewGroup container, int position) {
LayoutInflater inflater = LayoutInflater.from(context);
LinearLayout layout = new LinearLayout(context);
layout.setOrientation(LinearLayout.VERTICAL);
layout.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
FlexibleCalendarGridAdapter adapter = dateAdapters.get(position);
adapter.setOnDateClickListener(onDateCellItemClickListener);
adapter.setMonthEventFetcher(monthEventFetcher);
adapter.setCellViewDrawer(cellViewDrawer);
GridView view = (GridView) inflater.inflate(R.layout.month_grid_layout, null);
view.setTag(GRID_TAG_PREFIX + position);
view.setAdapter(adapter);
view.setVerticalSpacing(gridViewVerticalSpacing);
view.setHorizontalSpacing(gridViewHorizontalSpacing);
layout.addView(view);
container.addView(layout);
return layout;
}
代码示例来源:origin: samlss/Lighter
private void initGridView(){
mGridView = findViewById(R.id.gridview);
mGridView.setNumColumns(3);
mGridView.setAdapter(new Adapter());
mGridView.setVerticalSpacing(10);
mGridView.setHorizontalSpacing(10);
mGridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
showGuide(view);
}
});
}
代码示例来源:origin: pskink/PathDrawable
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
GridView gv = new GridView(this);
gv.setNumColumns(2);
gv.setVerticalSpacing(8);
gv.setHorizontalSpacing(8);
ListAdapter adapter = new Adapter();
gv.setAdapter(adapter);
setContentView(gv);
}
代码示例来源:origin: stackoverflow.com
GridView grid = new GridView( this );
grid.setColumnWidth( UIScheme.cellSize );
grid.setVerticalSpacing( UIScheme.gap );
grid.setStretchMode( GridView.STRETCH_COLUMN_WIDTH );
grid.setNumColumns( GridView.AUTO_FIT );
代码示例来源:origin: stackoverflow.com
GridView gridView;
int gridWidth = 1280;
int gridHeight = 500;
int gridItemWidth = 60;
int gridItemHeight = 50;
int gridRows = 3, gridColumns = 4;
int vSpacing = (gridHeight - (gridItemHeight * gridRows))/gridRows;
int hSpacing = (gridWidth - (gridItemWidth * gridColumns))/gridColumns;
gridView.setLayoutParams(new LayoutParams(gridWidth, gridHeight));
gridView.setColumnWidth(gridItemWidth);
gridView.setNumColumns(gridColumns);
gridView.setHorizontalSpacing(hSpacing);
gridView.setVerticalSpacing(vSpacing);
代码示例来源:origin: stackoverflow.com
GridView gv = new GridView(context);
gv.setId(999999);
gv.setLayoutParams(new
GridView.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
gv.setBackgroundColor(Color.GREEN);
gv.setNumColumns(3);
gv.setColumnWidth(GridView.AUTO_FIT);
gv.setVerticalSpacing(5);
gv.setHorizontalSpacing(5);
gv.setStretchMode(GridView.STRETCH_COLUMN_WIDTH);
gv.setGravity(Gravity.CENTER);
代码示例来源:origin: werbhelius/Werb
/**
* 创建显示表情的GridView
*/
private GridView createEmotionGridView(List<String> emotionNames, int gvWidth, int padding, int itemWidth, int gvHeight) {
// 创建GridView
GridView gv = new GridView(context);
gv.setBackgroundResource(R.color.bg_gray);
gv.setSelector(R.color.transparent);
gv.setNumColumns(7);
gv.setPadding(padding, padding, padding, padding);
gv.setHorizontalSpacing(padding);
gv.setVerticalSpacing(padding);
ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(gvWidth, gvHeight);
gv.setLayoutParams(params);
// 给GridView设置表情图片
EmotionGvAdapter adapter = new EmotionGvAdapter(context, emotionNames, itemWidth);
gv.setAdapter(adapter);
gv.setOnItemClickListener(this);
return gv;
}
代码示例来源:origin: AppLozic/Applozic-Android-SDK
public void createView() {
removeAllViews();
GridView gridView = new GridView(getContext());
LayoutParams params = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
gridView.setLayoutParams(params);
gridView.setNumColumns(3);
gridView.setHorizontalSpacing(1);
gridView.setVerticalSpacing(1);
gridView.setStretchMode(GridView.STRETCH_COLUMN_WIDTH);
prepareAttachmentData(gridView);
gridView.setOnItemClickListener(this);
addView(gridView);
}
代码示例来源:origin: stackoverflow.com
GridView grid = new GridView(this);
grid.setId(ViewIdentification.getId());
grid.setLayoutParams(new GridView.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
grid.setBackgroundColor(Color.WHITE);
grid.setNumColumns(3);
grid.setColumnWidth(GridView.AUTO_FIT);
grid.setVerticalSpacing(5);
grid.setHorizontalSpacing(5);
grid.setStretchMode(GridView.STRETCH_COLUMN_WIDTH);
内容来源于网络,如有侵权,请联系作者删除!