【发布时间】: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