import React, { Component } from 'react';
import { View, Text, StyleSheet, TouchableHighlight } from 'react-native';
class First extends Component {
render() {
return (
<View style = {styles.container}>
<Text>
Hello world!
</Text>
</View>
);
}
}
const styles = StyleSheet.create ({
container: {
backgroundColor: 'yellow',
flex: 1
}
});
module.exports = First;
此代码填写在项目的黄色画面开始react-native init
但显示没有在项目启动时create-react-native-app
。这是正常的吗?阵营母语:Flex的行为不同
编辑:这是从App.js中错误地从风格View
调用的。
“_but does not the same_”,它还有什么作用? –
@KhalilKhalaf它什么也没有显示。 –