gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-29 02:33:40 25 4
gpt4 key购买 nike

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

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com