Android Question Change scrollbar color for ScrollView2D

aironium

Member
I have been searching around the forums for a way to change scrollbar colors and there are only 2 entries available: "Scrollbar Color" and "Change Scrollbar Color of listView".
I tried applying and attempted to modify available snippets, but there was no effect. (And I am unsure how would I fill the "clr" value on the snippet when the subroutine is called, colors are usually in hex, therefore string not int)

Snippet from "Scrollbar Color":
Sub SetScrollbarColor(sv As ScrollView, clr As Int)
    Dim r As Reflector
    r.Target = sv
    r.Target = r.GetField("mScrollCache")
    r.Target = r.GetField("scrollBar")
    Dim cd As ColorDrawable
    cd.Initialize(clr, 5dip)
    r.RunMethod4("setVerticalThumbDrawable", Array(cd), Array As String("android.graphics.drawable.Drawable"))
End Sub


On my project, I used ScrollView2D as well.

Current Preview:

Screenshot_20230219-233821.jpg
 
Top