Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is possible to change color of ScrollBar?

I changed in ScrollView

android:fadeScrollbars="false"

to ScrollBar be visible and it works fine. My question is possible to change color of ScrollBar ? ( Default is gray and my background is gray so there is small contrast between ).

like image 554
Damir Avatar asked Jan 23 '12 12:01

Damir


People also ask

How do I change the scrollbar color in Chrome?

Left-click and drag the small circle on the Scrollbar thumb color palette to select a color there. You can also choose different shades for your selected color by dragging the HSV bar sliders up and down. Drag the circle within the Scrollbar track color palette to choose a color for the track bar.

How do I color my scroll bar in CSS?

light will tell the user agent to use lighter scrollbars to match the current color scheme. <color> specifies two colors to be used for the scrollbar. The first color is for the “thumb” or the moveable part of the scrollbar which appears on top. The second color is for the “track” or the fixed portion of the scrollbar.

What is scrollbar color?

The scrollbar-color CSS property sets the color of the scrollbar track and thumb. The track refers to the background of the scrollbar, which is generally fixed regardless of the scrolling position. The thumb refers to the moving part of the scrollbar, which usually floats on top of the track.


2 Answers

You can with android:scrollbarThumbVertical="@drawable/youdrawable

In my case, for instance yourdrawable is:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">

    <gradient android:startColor="#66C0C0C0" android:endColor="#66C0C0C0"
        android:angle="45"/>

    <corners android:radius="6dp" />

</shape>
like image 168
Blackbelt Avatar answered Sep 19 '22 12:09

Blackbelt


You can use:android:scrollbarThumbVertical="@drawable/yourImage" , where 'yourImage' can be a small 2 pixel image of ur desired color

like image 22
Saurabh Verma Avatar answered Sep 17 '22 12:09

Saurabh Verma