Import_this
import {AppRegistry, Text, View, Button, StyleSheet} from 'react-native';
陣營本地按鈕式的不行
這是我的陣營按鈕的代碼,但風格不工作野兔......
<Button
onPress={this.onPress.bind(this)}
title={"Go Back"}
style={{color: 'red', marginTop: 10, padding: 10}}
/>
而且我是通過這個代碼嘗試
<Button
containerStyle={{padding:10, height:45, overflow:'hidden',
borderRadius:4, backgroundColor: 'white'}}
style={{fontSize: 20, color: 'green'}}
onPress={this.onPress.bind(this)} title={"Go Back"}
> Press me!
</Button>
更新問題:
而且我是通過這種方式嘗試..
<Button
onPress={this.onPress.bind(this)}
title={"Go Back"}
style={styles.buttonStyle}
>ku ka</Button>
風格
const styles = StyleSheet.create({
buttonStyle: {
color: 'red',
marginTop: 20,
padding: 20,
backgroundColor: 'green'
}
});
'按鈕'你使用自定義組件或反應按鈕組件? –
也許會有反應'按鈕 –
它沒有'style'屬性。請檢查一次。 –