【问题标题】:How to increase the height of the react-native Slider component?如何增加 react-native Slider 组件的高度?
【发布时间】:2018-11-09 05:44:20
【问题描述】:

我正在开发一个 react-native 项目......我的一个案例是我需要在 react-native 中使用 Slider 组件。

<Slider 
  minimumTrackTintColor='blue'
  maximumTrackTintColor='red'
  width={300}
  value={16}
  minimumValue ={0}
  maximumValue={100}
/>

我可以控制 Slider 组件的宽度,但我需要增加 Slider 的高度。有什么建议吗?

【问题讨论】:

  • 你能告诉我们你在项目中使用了什么组件吗?

标签: reactjs react-native react-native-android


【解决方案1】:

怎么样

style={{height:300}}

【讨论】:

    【解决方案2】:

    official documentation中可以看到:

    • 按照新组件的docs,尝试使用这个:

      风格={{高度:40}}

      <Slider
          style={{width: 200, height: 40}}
      />
      

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-12-22
      • 1970-01-01
      • 2015-12-10
      • 2012-10-13
      • 2023-02-22
      • 1970-01-01
      • 2021-12-27
      相关资源
      最近更新 更多