簡體   English   中英

當用戶在 React Native Android 中設置暗模式時,如何更改 ScrollView 滾動條的顏色?

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

長話短說,如果我使用<ScrollView>元素,而我的決定沒有打開暗模式,則滾動條是深灰色的,但是,如果用戶打開了暗模式,它的顏色會變淺並與我的應用程序的背景融為一體.

我想知道是否有一種簡單的方法可以在 Android React Native 中打開暗模式時更改 ScrollView 滾動條的顏色?

您可以使用 react-native-scrollbar 庫在您的應用程序中設置滾動條顏色:嘗試

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

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM