【问题标题】:React Native Color Style反应本机颜色样式
【发布时间】:2018-08-20 17:02:33
【问题描述】:

这里我附上了一张图片。根据图像,该条具有深蓝色和浅蓝色混合。我该如何完成该任务?

【问题讨论】:

  • 你需要添加一个从dark bluelight blue的线性渐变
  • 谢谢。应该是这样的方法。

标签: react-native react-native-stylesheet


【解决方案1】:

使用react-native-linear-gradient 库:

import { StyleSheet } from 'react-native';
import LinearGradient from 'react-native-linear-gradient';

const styles = StyleSheet.create({
  linearGradient: {
     width: 40px, height: 250px
  }
})

...

render() {
  <LinearGradient colors={['#319CF7', '#BDE0FB']} style={styles.linearGradient} />
}

【讨论】:

    猜你喜欢
    • 2021-03-15
    • 2021-01-03
    • 2019-01-10
    • 1970-01-01
    • 2020-10-12
    • 1970-01-01
    • 1970-01-01
    • 2021-10-23
    • 1970-01-01
    相关资源
    最近更新 更多