2
私は、反応ネイティブでボタンを持つ単純なアプリケーションを作成しようとしていますが、これまで私のコードを実行するたびに、 "変数を見つけることができません:ボタン"。一番上のタイトル(既に終わっている)と画面の中央にあるボタンを押して、タッチしたときに警告が表示されるようにしたいと思います。変数を見つけることができません:ボタン - 反応ネイティブ
私はいくつかのオンラインチュートリアルを実行しており、解決策を見つけることができません。事前に
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';
class Project extends Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.Title}>
Lucas's App
</Text>
<View style={styles.buttonContainer}>
<Button
onPress={() => { Alert.alert('You tapped the button!')}}
title="Press Me"
/>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#F5FCFF',
},
Title: {
color: '#000000',
marginTop: 13,
paddingLeft:100,
paddingRight:100,
fontFamily: 'Avenir',
fontSize: 30,
},
buttonContainer: {
margin: 20
},
});
AppRegistry.registerComponent('Project',() => Project);
ありがとう:
は、ここに私のコードです。
ボタンをインポートしたようにそれは見えません。 –
どうすればいいですか? –