本文整理了Java中android.widget.GridView.getCount()
方法的一些代码示例,展示了GridView.getCount()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GridView.getCount()
方法的具体详情如下:
包路径:android.widget.GridView
类名称:GridView
方法名:getCount
暂无
代码示例来源:origin: stackoverflow.com
@Override
protected void onPause() {
GridView gridView = (GridView) findViewById(R.id.public_photos);
int count = gridView.getCount();
for (int i = 0; i < count; i++) {
ImageView v = (ImageView) gridView.getChildAt(i);
if (v != null) {
if (v.getDrawable() != null) v.getDrawable().setCallback(null);
}
}
super.onPause();
}
代码示例来源:origin: LiuGuiLinAndroid/LoveWallpaper
@Override
public void onScrollStateChanged(AbsListView absListView, int i) {
if (i == AbsListView.OnScrollListener.SCROLL_STATE_IDLE) {
if (mGridView.getLastVisiblePosition() == mGridView.getCount() - 1) {
ll_load_more.setVisibility(View.VISIBLE);
loadData();
}
}
}
代码示例来源:origin: LiuGuiLinAndroid/LoveWallpaper
@Override
public void onScrollStateChanged(AbsListView absListView, int i) {
if (i == AbsListView.OnScrollListener.SCROLL_STATE_IDLE) {
if (mGridView.getLastVisiblePosition() == mGridView.getCount() - 1) {
ll_load_more.setVisibility(View.VISIBLE);
loadData();
}
}
}
代码示例来源:origin: SimonMarquis/Android-PreferencesManager
@Override
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
switch (item.getItemId()) {
case R.id.action_delete:
((PreferenceAdapter) gridView.getAdapter()).deleteSelection();
Utils.savePreferences(preferenceFile, mFile, mPackageName, getActivity());
((PreferenceAdapter) gridView.getAdapter()).notifyDataSetChanged();
mode.finish();
return true;
case R.id.action_select_all:
boolean check = gridView.getCheckedItemCount() != gridView.getCount();
for (int i = 0; i < gridView.getCount(); i++) {
gridView.setItemChecked(i, check);
}
return true;
default:
return false;
}
}
内容来源于网络,如有侵权,请联系作者删除!