简体   繁体   中英

How to change the colour of a ScrollView's scrollbar when the user has set dark mode on in React Native Android?

Long story short, if I use a <ScrollView> element while my decide doesn't have dark mode on, the scrollbar is dark grey-ish, however, if the user has dark mode on, it's lighter colour and blends with my app's background.

I was wondering if there's a simple way to change the colour of a ScrollView's scrollbar when dark mode in on in Android React Native?

you could use the react-native-scrollbar library to set the scrollbar color in your app: Try

import { ScrollView } from 'react-native-scrollbar';

<ScrollView
scrollbarColor="#FF0000"
// other props here
>
{/* content goes here */}
</ScrollView>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM