Change the color of scroll bar

List view or Scroll view, if you need to change the scroll bar, Just add below the lines.

Create the xml file in drawable folder,

scrollbar_thumbs.xml

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

    <gradient
        android:angle="45"
        android:centerColor="#1D862D"
        android:endColor="#4D8F57"
        android:startColor="#1D862D" />

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

</shape>

Add this on your listview like that,

android:scrollbarThumbVertical="@drawable/scrollbar_thumbs"




Comments

Popular posts from this blog

Clear the app data programmatically in android

convert an integer to a string in java

Print the large string values in android log cat.