Control style - seowonintech/react-native-todo-list GitHub Wiki

style

control마다 style을 지정해줄 수 있다. 만약 여러 스타일을 조합하고 싶다면?

array로 중복해서 사용할 수 있다.
아래 참고 사이트에 가면 아래와 같은 말을 볼 수 있다.

The style prop can be a plain old JavaScript object. That's the simplest and what we usually use for example code. You can also pass an array of styles - the last style in the array has precedence

참고 사이트

Style

참고 예제

const RadioButton = (props) => {
  return (
    <View style={[{
      height: 24,
      width: 24,
      borderRadius: 12,
      borderWidth: 2,
      borderColor: '#000',
      alignItems: 'center',
      justifyContent: 'center',
    }, props.style]}>
      {
        props.selected ?
          <View style={{
            height: 12,
            width: 12,
            borderRadius: 6,
            backgroundColor: '#000',
          }} />
          : null
      }
    </View>
  );
}
⚠️ **GitHub.com Fallback** ⚠️