android.widget.ListView.smoothScrollToPositionFromTop()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(148)

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

ListView.smoothScrollToPositionFromTop介绍

暂无

代码示例

代码示例来源:origin: Ramotion/direct-select-android

@Override
  public void run() {
    listView.smoothScrollToPositionFromTop(firstVisibleItem, 0, subScrollDuration);
    hideListView();
  }
}, 0);

代码示例来源:origin: lordi/tickmate

public void scrollToLatest() {
  int scrollposition = (isTodayAtTop) ? 0 : this.count - 1;
  ((ListActivity) context).getListView().smoothScrollToPositionFromTop(scrollposition, 1, 0);
}

代码示例来源:origin: sismics/reader

@Override
public void onPageSelected(int position) {
  // We reached the latest page, load more articles if needed
  if (position + 1 >= sharedAdapterHelper.getArticleItems().size()) {
    sharedAdapterHelper.load(ArticleActivity.this);
  }
  
  // Store article id to mark as read later
  final JSONObject article = sharedAdapterHelper.getArticleItems().get(position);
  String articleId = article.optString("id");
  if (!readArticleIdSet.contains(articleId) && !article.optBoolean("force_unread")) {
    readArticleIdSet.add(article.optString("id"));
  }
  // Scroll the ListView
  if (drawerLayout == null) {
    if (drawerList.getCheckedItemCount() == 0) {
      // Don't be smooth when the activity has just opened
      drawerList.setSelectionFromTop(position, 100);
    } else {
      drawerList.smoothScrollToPositionFromTop(position, 100);
    }
    drawerList.setItemChecked(position, true);
  }
  // Update the action bar
  updateActionBar();
}

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

list.smoothScrollToPositionFromTop(list.getLastVisiblePosition() + 1, 0, 10000);
try {

相关文章

ListView类方法