switch 开关组件
switch 组件 ,通过style的width,height是无法设置组件大小,以下代码无效
<Switch onValueChange={this._changeReciveNotice.bind(this)}
value={this.state.isReciveNotice}
style={{width:20,height:10}}/>
解决办法 :只能通过transform来设置
<Switch value={true}
style={{ transform: [{ scaleX: .8 }, { scaleY: .8 }] }} //百分比表示相对原大小的倍数
onValueChange={(value) => {}} />
网友评论