【发布时间】:2020-09-18 10:29:02
【问题描述】:
当我按下按钮时,我希望它获得 button2 主题而不是 buttondefault。我该怎么做? (我在 react-native 文档中找不到,有链接吗?)
export default class deneme extends Component {
constructor(props) {
super(props);
this.state = {
};
}
render() {
return (
<View style={{flex:1, justifyContent:'center', alignItems:'center'}}>
<TouchableOpacity
onPress={() => this.pressme()}
style={styles.buttondefault}>
<Text style={{fontSize:40}}> B </Text>
</TouchableOpacity>
</View>
);
}
}
const styles = StyleSheet.create({
buttondefault:{
width:100,
height:50,
backgroundColor:'green'
},
button2:{
width:50,
height:100,
backgroundColor:'green'
},
});
【问题讨论】:
标签: android react-native android-button android-theme