Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change color of ScrollView indicator

I am trying to change the color of scroll indicator of ScrollView in react-native. If I use this prop on Android I will get an error, that indicatorStyle is not a valid property. Now this is not suprising because it is described in documentation it is suppoerted only on iOS.

Now the question is, is there a way to change the color of indicator on Android?

like image 502
doubleW Avatar asked Sep 06 '25 03:09

doubleW


1 Answers

Create a xml scrollbar

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


<gradient 
      android:angle="45" 
      android:endColor="#FF3401"    
      android:centerColor="#ff5c33" 
      android:startColor="#FF3401" /> 
      <corners android:radius="8dp" /> 

</shape>

and add this scroll bar like

 android:scrollbarThumbVertical="@drawable/scrollbar

like image 169
ismail alaoui Avatar answered Sep 08 '25 00:09

ismail alaoui