Custom scrollbar Android

后端 未结 2 499
日久生厌
日久生厌 2020-12-23 10:14

How I can make this scrollbar:

\"\"

2条回答
  •  自闭症患者
    2020-12-23 10:57

    To change the thumb image you can simply create the following style and apply it to your ScrollView:

    
    

    where scroller_thumb is your custom image for the scroller thumb.

    also note the following attributes:

    1. "android:fadeScrollbars" which is set to false to make the thumb image stay permanently.
    2. "android:scrollbarStyle" which is set to outsideOverlay to make the thumb image drawn at the "Edge of the view and overlaid" as stated here: android:scrollbarStyle

    Now, in order to put the thin line you want under the scroller, simply add an image view containing the line image, to the direct child of the ScrollView (RelativeLayout child as a direct child for the ScrollView will allow you to position the image on the right side of the view - so this is would have been my choice).

    and that's it.

提交回复
热议问题