本文介绍了如何在android WebView中使用自定义滚动条滚动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
限时送ChatGPT账号..我想在android WebView中使用自定义ScrollBars;并且还想使用该滚动条来滚动 WebView 内容.我知道我们可以使用以下方法显示滚动条:
I want to use custom ScrollBars in android WebView; and also want to use that scrollbar to scroll WebView content. I know that we can show scrollbars using:
mWebView.setVerticalScrollBarEnabled(true);
mWebView.setHorizontalScrollBarEnabled(true);
但是,如果我使用默认滚动条,则无法通过拖动滚动条来滚动 WebView 的内容.
But if I use thode default scrollbars, then I am not able to scroll the content of WebView by dragging scrollbar.
推荐答案
自定义 WebView 的 Scroll Bar 很容易.只需将此属性代码添加到您自定义的 WebView 的 xml 中即可:
It's easy to custom Scroll Bar of WebView. Just add this attribute code to xml of WebView with your custom:
android:scrollbarThumbVertical="@drawable/your_custom_scrollbar_thumb"
android:scrollbarTrackVertical="@drawable/your_custom_scrollbar_track"
这篇关于如何在android WebView中使用自定义滚动条滚动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论