如何将样式数组应用于原生组件?我有这种风格:
const React = require('react-native');
const { StyleSheet } = React;
export default StyleSheet.create({
container: {
backgroundColor: '#FBFAFA',
},
rowView:{
flexDirection: 'row',
borderRadius: 5
},
btn : {
borderRadius: 5,
margin: 5
},
on : {
backgroundColor: '#FFF',
},
off : {
backgroundColor: 'rgba(0,0,0,0.2)',
},
green : {
backgroundColor: 'green',
},
red : {
backgroundColor: 'red',
}
});
我想申请这样的组件:
<View style={[styles.red, styles.rowView]} padder>
我在原生基础中看到他们使用 getTheme。这是唯一的方法吗?