这是我的项目文件夹 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/