条件造型

<View style={[(this.props.isTrue) ? styles.bgcolorBlack : styles.bgColorWhite]}>

如果 isTrue 的值是 true 那么它将具有黑色背景颜色,否则为白色。