当我在ios模拟器上运行我的应用程序时,它不会崩溃。但是当我在android模拟器上运行它时,expo下载了JS包,但在2-3秒后(在expo加载时),它崩溃了,返回到android主页上……
App.js:
import React from 'react';
import { Text, View, SafeAreaView } from 'react-native';
const App = () => {
return (
<View
style={{
flex: 1,
justifyContent: 'Center',
alignItems: 'Center',
backgroundColor: 'rgb(255,255,255)',
}}>
<Text
style={{
color: 'rgb(44,44,44)',
textAlign: 'center',
width: '100%',
}}>
Hello World!
</Text>
</View>
);
};
export default App;
谢谢!
发布于 2021-07-04 19:43:18
在样式中使用字符串的小写值。
import React from 'react';
import { Text, View, SafeAreaView } from 'react-native';
const App = () => {
return (
<View
style={{
flex: 1,
justifyContent: 'center', // <-- fixed
alignItems: 'center', // <-- fixed
backgroundColor: 'rgb(255,255,255)',
}}>
<Text
style={{
color: 'rgb(44,44,44)',
textAlign: 'center',
width: '100%',
}}>
Hello World!
</Text>
</View>
);
};
export default App;
https://stackoverflow.com/questions/68244237
复制相似问题