[英]White blank screen on android while running react native
這是我的項目文件夾項目文件夾
當我第一次在設備中啟動項目時,一切工作正常。 我想學習React導航,所以我點擊了此鏈接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'
}
});
為什么顯示白色的空白屏幕? 提前致謝
react-native版本似乎存在問題,將您的react-native版本降級到0.49,然后應該可以。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.