그라데이션 색상을 주기 위해 서드파티 라이브러리를 사용했다
react-native-linear-gradient
처음 react-native 를 접할 때는 이것도 무서워서 망설여졌던 것 같은데
지금은 그냥 해보고 아니면 지우지 라는 마인드..ㅎ
import LinearGradient from 'react-native-linear-gradient'
return (
<LinearGradient
start={{ x: 0.0, y: 0.25 }}
end={{ x: 0.5, y: 1.0 }}
colors={['#4c669f', '#3b5998', '#192f6a']}
locations={[0, 0.4, 0.85]}
style={{ borderRadius: 20 }}
>
<View
style={{
borderRadius: 20,
height: 32,
width: '100%',
alignItems: 'center',
justifyContent: 'center',
}}
>
<Text style={{ color: 'white', fontWeight: 'bold' }}>text</Text>
</View>
</LinearGradient>
)
색상을 예쁘게 주는 것도 좋긴한데
퍼블리싱 보다는 개발이 더 취향인 것 같긴 하다