本文整理了Java中android.webkit.WebView.scrollTo()
方法的一些代码示例,展示了WebView.scrollTo()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebView.scrollTo()
方法的具体详情如下:
包路径:android.webkit.WebView
类名称:WebView
方法名:scrollTo
暂无
代码示例来源:origin: chaychan/TouTiao
mNestedWebView.scrollTo(mNestedWebView.getScrollX(), 0);
代码示例来源:origin: appnexus/mobile-sdk-android
@Override
public void scrollTo(int x, int y) {
super.scrollTo(0, 0);
}
代码示例来源:origin: namndbka/QDict
public static void showHtmlContent(String content, WebView webView) {
if (webView != null) {
if (!content.contains("<body style='color:")) {
content = "<body style='color:" + getTextHtmlColor() + "'>" + content + "</body>";
}
try {
webView.loadDataWithBaseURL(null, content, Def.MIME_TYPE, Def.HTML_ENCODING, null);
} catch (Exception ex) {
Log.e("QDictions", ex.toString());
}
webView.scrollTo(0, 0);
}
}
代码示例来源:origin: calvinaquino/LNReader-Android
@Override
public void onProgressChanged(WebView view, int progress) {
Log.d(TAG, "Progress: " + progress);
final DisplayLightNovelContentActivity caller = activityRef.get();
if (caller != null) {
ProgressBar progressBar = (ProgressBar) caller.findViewById(R.id.loadProgress);
if (progressBar != null) {
if (progress < 100) {
progressBar.setVisibility(View.VISIBLE);
progressBar.setProgress(progress);
} else {
progressBar.setVisibility(View.GONE);
if(this.requireScroll) {
view.scrollTo(0, this.scrollY);
this.requireScroll = false;
}
}
}
}
}
}
代码示例来源:origin: stackoverflow.com
webView.scrollTo(x, y);
代码示例来源:origin: AEFeinstein/mtg-familiar
view.findViewById(R.id.mtr_ipg_jump_to_top).setOnClickListener(v -> webView.scrollTo(0, 0));
代码示例来源:origin: stackoverflow.com
public void onScroll(int x, int y) {
Log.d("MainActivity", "We Scrolled etc..." + " X " + x + " Y " + y);
webViewMirror.scrollTo(x,y);
代码示例来源:origin: kmshack/Android-TopScrollHelper
private void doScroll(){
for (View view : mTargetScrollView) {
if (DEBUG)
Log.d(TAG, "is shown ? " + view.isShown());
if (view.isShown()) {
if (view instanceof AbsListView) {
if (((AbsListView) view).getAdapter() != null && ((AbsListView) view).getAdapter().getCount() > 15)
((AbsListView) view).setSelection(15);
((AbsListView) view).smoothScrollToPosition(0, 0);
} else if (view instanceof ScrollView) {
((ScrollView) view).smoothScrollTo(0, 0);
} else if (view instanceof WebView) {
((WebView) view).scrollTo(0, 0);
} else if(view instanceof RecyclerView){
if (((RecyclerView) view).getAdapter() != null && ((RecyclerView) view).getAdapter().getItemCount() > 15 && ((RecyclerView) view).getLayoutManager()!=null) {
((RecyclerView) view).getLayoutManager().scrollToPosition(15);
}
((RecyclerView)view).smoothScrollToPosition(0);
} else if(view instanceof NestedScrollView){
((NestedScrollView) view).smoothScrollTo(0, 0);
}
}
}
}
代码示例来源:origin: stackoverflow.com
mWebview.scrollTo(681, 100);
代码示例来源:origin: Y-bao/PullRefreshView
@Override
public void scrollAViewBy(int dp) {
float maxScrollY = webView.getContentHeight() * webView.getScale() - webView.getMeasuredHeight();
if (webView.getScrollY() + dp >= maxScrollY) {
webView.scrollTo(0, (int) maxScrollY);
} else {
webView.scrollBy(0, dp);
}
}
}
代码示例来源:origin: stackoverflow.com
scrollView.scrollTo((int)event.getX(), (int)(scrollView.getContentHeight()*scrollView.getScale()-600));
v.getParent()
.requestDisallowInterceptTouchEvent(false);
scrollView.scrollTo((int)event.getX(), (int)0);
v.getParent()
.requestDisallowInterceptTouchEvent(false);
代码示例来源:origin: vihuela/RAD
mNestedWebView.scrollTo(mNestedWebView.getScrollX(), 0);
内容来源于网络,如有侵权,请联系作者删除!