Android Question Want to Hide Scroll Bars in WebView

Johnson Samuel

Member
Licensed User
Longtime User
<code>
WebView.LoadHtml("<html>somecode</html>")

Dim no As JavaObject = WebView
no.GetFieldjo("scrollView").SetField("showsHorizontalScrollIndicator", False)
no.GetFieldjo("scrollView").SetField("showsVerticalScrollIndicator", False)

</code>

error message:
java.lang.RuntimeException: Field: scrollView not found in: android.webkit.WebView

I want to hide both horizontal and vertical scroll bars.
Can any expert help?
 

Eme Fibonacci

Well-Known Member
Licensed User
Longtime User
B4X:
Sub setScrollBarEnabled(v As View, vertical As Boolean, horizontal As Boolean)
    Dim jo = v As JavaObject
    jo.RunMethod("setVerticalScrollBarEnabled", Array As Object (vertical))
    jo.RunMethod("setHorizontalScrollBarEnabled", Array As Object (horizontal))
End Sub
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…