首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Android:下载JS包后应用崩溃

Android:下载JS包后应用崩溃
EN

Stack Overflow用户
提问于 2021-07-04 19:24:04
回答 1查看 239关注 0票数 1

当我在ios模拟器上运行我的应用程序时,它不会崩溃。但是当我在android模拟器上运行它时,expo下载了JS包,但在2-3秒后(在expo加载时),它崩溃了,返回到android主页上……

App.js:

代码语言:javascript
复制
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;

谢谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-07-04 19:43:18

在样式中使用字符串的小写值。

代码语言:javascript
复制
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;

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68244237

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档