【问题标题】:Is it possible to change scrollbar color in react native是否可以在本机反应中更改滚动条颜色
【发布时间】:2020-11-04 18:00:00
【问题描述】:

我可以在 react native 中创建自定义滚动条,看起来像这张图片吗?

谢谢

【问题讨论】:

标签: react-native scrollview scrollbar react-native-scrollview


【解决方案1】:

我终于找到了解决方案。 使用这个包 react-native-scroll-indicator

这是我的代码

<ScrollViewIndicator
    shouldIndicatorHide={false}
    flexibleIndicator={false}
    scrollIndicatorStyle={{ backgroundColor: 'pink' }}
    scrollIndicatorContainerStyle={{ backgroundColor: 'rgba(0, 0, 0, 0.1)' }}
>
    ...
</ScrollViewIndicator>

【讨论】:

    猜你喜欢
    • 2017-04-12
    • 1970-01-01
    • 2011-06-24
    • 2011-03-05
    • 1970-01-01
    • 2020-03-27
    • 1970-01-01
    • 2020-09-15
    • 1970-01-01
    相关资源
    最近更新 更多