Javascript 抽屉式抽屉没有显示任何东西?
我正在尝试显示React Native的Javascript 抽屉式抽屉没有显示任何东西?,javascript,react-native,Javascript,React Native,我正在尝试显示React Native的[DrawerLayoutAndroid][1]组件: /** * Sample React Native App * https://github.com/facebook/react-native */ 'use strict' import React, { AppRegistry, Component, StyleSheet, Text, TextInput, View, ScrollView, DrawerL
[DrawerLayoutAndroid][1]
组件:
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict'
import React, {
AppRegistry,
Component,
StyleSheet,
Text,
TextInput,
View,
ScrollView,
DrawerLayoutAndroid
} from 'react-native'
class Dictionary extends Component {
constructor(props) {
super(props)
this.state = {
movies: 'Test'
}
}
render() {
const navigationView = (
<View style={{flex: 1, backgroundColor: '#fff'}}>
<Text style={{margin: 10, fontSize: 15, textAlign: 'left'}}>Im in the Drawer!</Text>
</View>
)
return (
<ScrollView>
<DrawerLayoutAndroid
drawerWidth={300}
drawerPosition={DrawerLayoutAndroid.positions.Left}
renderNavigationView={() => navigationView}>
<View style={{flex: 1, alignItems: 'center'}}>
<Text style={{margin: 10, fontSize: 15, textAlign: 'right'}}>Hello</Text>
<Text style={{margin: 10, fontSize: 15, textAlign: 'right'}}>World!</Text>
</View>
</DrawerLayoutAndroid>
<View style={styles.parent}>
<Text>
Type something in English:
</Text>
<TextInput/>
<Text style={styles.germanLabel}>
Movies: { this.state.movies }
</Text>
</View>
</ScrollView>
)
}
}
const styles = StyleSheet.create({
parent: {
padding: 16
},
germanLabel: {
marginTop: 20,
fontWeight: 'bold'
},
germanWord: {
marginTop: 15,
fontSize: 30,
fontStyle: 'italic'
}
})
AppRegistry.registerComponent('Dictionary', () => Dictionary)
/**
*示例React本机应用程序
* https://github.com/facebook/react-native
*/
“严格使用”
进口反应{
评估学,
组成部分,
样式表,
文本,
文本输入,
看法
滚动视图,
抽屉式抽屉
}从“反应本机”
类字典扩展组件{
建造师(道具){
超级(道具)
此.state={
电影:《测试》
}
}
render(){
常量导航视图=(
我在抽屉里!
)
返回(
导航视图}>
你好
世界!
用英语输入:
电影:{this.state.Movies}
)
}
}
const styles=StyleSheet.create({
家长:{
填充:16
},
德国标签:{
玛金托普:20,
fontWeight:“粗体”
},
德国字:{
玛金托普:15,
尺寸:30,
字体:“斜体”
}
})
AppRegistry.registerComponent('Dictionary',()=>Dictionary)
但是,该应用程序不会显示任何内容:
原因可能是什么?(也没有任何错误消息,看起来一切都编译得很好。)尝试将DroperLayoutAndroid作为根节点。文档中没有这方面的信息,但帮助了我。这对您有帮助吗?尝试将DroperLayoutAndroid作为根节点。文档中没有这方面的信息,但帮助了我。这对您有帮助吗?您好,我有相同的问题DroperLayoutAndroid中的任何内容都不可见,即使在创建DroperLayoutAndroid根节点之后我也有相同的问题DroperLayoutAndroid中的任何内容都不可见,即使在创建DroperLayoutAndroid根节点之后