react native 渐变组件 react-native-linear-gradient

github:  https://github.com/react-native-community/react-native-linear-gradient

 

安装:yarn add  react-native-linear-gradient

link:  react-native link   react-native-linear-gradient

link后在看看相关的配置 是否会全部都配置上了

 

使用:

      <LinearGradient colors={['#FFD801', '#FF8040', '#F75D59']} style={styles.linearGradient}>
        <Text style={{color:'#fff'}}>
          Sign in with Facebook
        </Text>
      </LinearGradient>

 

  linearGradient: {
  justifyContent:'center',
  alignItems:'center',
  width:200,
  height:50,
  paddingLeft: 15,
  paddingRight: 15,
  borderRadius: 5
},

 效果:

posted @ 2017-09-04 17:40  谢玉胜  阅读(8266)  评论(1编辑  收藏
WELCOME