javascript - 运行时 android 上的白色空白屏幕 react native

标签 javascript android react-native

这是我的项目文件夹 Project folder

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

screens folder

索引.android.js

import App from './src/App';

索引.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);

启动屏幕.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'

    }
    });

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

最佳答案

好像是react-native版本的问题,把你的react-native版本降到0.49就可以了。

关于javascript - 运行时 android 上的白色空白屏幕 react native ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48240798/

相关文章:

ios - ScrollViewClass 不能未定义 - react native iOS

ios - 无效的目录/用户/node_modules/superagent 与 React Native

react-native - 将 Zoho Sign 集成到 React Native

javascript - 发布到服务器时如何处理extjs 4的动态加载?

javascript - Backbone 中 Underscore 的 .defer() 导致错误 : Cannot call method 'apply' of undefined

java - 如何在android中使用计时器设置进度条?

android - 从 Firebase 存储中检索图像 url 并将其放入警报对话框中

javascript - 在哪里可以找到要添加到 babel.config.js 的 polyfill 名称

javascript - 在数据变化时使用 Angular 动画集合的第一个元素

android - 在回调 viewpager fragment on back press 时出现此错误您必须先在 child 的 parent 上调用 removeView()