【问题标题】:White blank screen on android while running react native运行本机反应时Android上的白色空白屏幕
【发布时间】:2018-01-13 14:28:26
【问题描述】:

这是我的项目文件夹Project folder

当我第一次将项目启动到我的设备中时,一切都运行良好。 我想学习反应导航,所以我点击了这个链接https://wix.github.io/react-native-navigation/#/installation-android 安装 react-native 导航并尝试在我的

中将启动屏幕作为启动屏幕

屏幕文件夹

Index.android.js

import App from './src/App';

index.js

import { Navigation } from 'react-native-navigation';
import startupscreen from './startupscreen';

export function registerScreens() {
   Navigation.registerComponent('dudenew.startupscreen', () => 
 startupscreen);
}

App.js

import { Navigation } from 'react-native-navigation';

 import React, { Component } from 'react';
 import {
 AppRegistry,
 } from 'react-native';

 import { registerScreens } from './screens';

 registerScreens();


 AppRegistry.registerComponent('dudenew', () => dudenew);

startupscreen.js

import React , { Component }  from 'react';
 import{
    Text,
  Image,
  View,
  StyleSheet,

 } from 'react-native';


 export default class startupscreen extends Component{
render(){

    return(
        <View style = {styles.container}>

            <View style = {styles.logotext}>

                <Text>
                    <Text>Hellooo  </Text>
                    <Text style = {{color: 'blue'}}> hh </Text>
                </Text>
            </View>
        </View>

    );
}
  }
       const styles = StyleSheet.create({
      container : {
                  flex : 1,
            backgroundColor : 'blue'

},
logotext : {
    alignItems : 'center',
    flexGrow : 1,
    justifyContent:'center'

    }
    });

为什么它显示白色的空白屏幕?提前致谢

【问题讨论】:

  • 你找到答案了吗?如果是这样,请在此处写下解决方案

标签: javascript android react-native


【解决方案1】:

好像是 react-native 版本的问题,把你的 react-native 版本降到 0.49 应该没问题。

【讨论】:

    猜你喜欢
    • 2017-02-25
    • 1970-01-01
    • 2021-09-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-17
    • 1970-01-01
    相关资源
    最近更新 更多