【问题标题】:react-native-swiper: Is there a way to custom the style of the dots? [closed]react-native-swiper:有没有办法自定义点的样式? [关闭]
【发布时间】:2020-03-12 07:19:12
【问题描述】:

我添加了我想要更改的点的图片。

this is the picture.

我正在使用react-native-swiper

有没有办法改变 swiper 中点的样式(颜色、大小..)?

<Swiper
  style={styles.wrapper}
  showsButtons={false}
  onIndexChanged={this.onSwiperIndexChanged}
  index={this.state.initialIndex} //{list.length - this.state.initialIndex - 1}
>
  {list.map((item, index) => (
    <InfoTable
      key={index}
      headerInfo={item}
      approvers={approvers}
      settings={settings}
    />
  ))}
</Swiper>;

【问题讨论】:

  • 您将不得不深入研究该库的代码并进行相应的修改。
  • @TheRakeshPurohit Nop,他们提供了 API

标签: javascript css reactjs react-native react-native-swiper


【解决方案1】:

是的,你可以

参考文档swiper-pagination

允许自定义点元素。

<View
  style={{
    backgroundColor: "rgba(0,0,0,.2)",
    width: 8,
    height: 8,
    borderRadius: 4,
    marginLeft: 3,
    marginRight: 3,
    marginTop: 3,
    marginBottom: 3
  }}
/>;

【讨论】:

  • 你能告诉我如何在我的代码中做到这一点吗?因为我已经尝试过了,但它对我不起作用
  • @mia 您能否添加一些有关您所面临问题的详细说明?或者添加在线演示?
  • 我在我的问题中添加了我想改变它们样式的点的图片
  • @mia 猜猜看,你需要弄清楚你面临的问题是什么,而不是添加一张图片等待别人实现它。如果您对向dot 添加自定义样式有疑问,相信我已经回答了。如果你还有更多的 CSS 设置问题,最好用一个新的问题详细解释一下。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-09-25
  • 1970-01-01
  • 1970-01-01
  • 2021-04-11
相关资源
最近更新 更多