假设我想使用具有以下定义样式的Component:
var styles = StyleSheet.create({
container: {
backgroundColor: '#ffffff'
},
});
Run Code Online (Sandbox Code Playgroud)
我能像这样覆盖我的基本风格吗?
<Component style={backgroundColor: 'transparent'}></Component>
Run Code Online (Sandbox Code Playgroud)
它对我不起作用,所以想知道这是否取决于Component是否支持该行为.
d-v*_*ine 30
描述有点模糊.它是你写下自己的一个组成部分吗?假设它应该像这样工作:
export default React.createClass({
render: function(){
return(<View style={[ styles.container, this.props.style ]}>...</View>
}
})
var styles = StyleSheet.create({
container: {
backgroundColor: '#ffffff'
},
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
16296 次 |
| 最近记录: |