-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.drawerlayout.js
36 lines (32 loc) · 1.03 KB
/
test.drawerlayout.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import React, {
Component,
} from 'react';
import {
AppRegistry,
View,
Text,
TextInput,
DrawerLayoutAndroid
} from 'react-native';
class DrawerLayoutDemo extends Component {
render(){
var navigationView = (
<View style={{flex: 1, backgroundColor: 'blue'}}>
<Text style={{margin: 10,color:'#fff',fontSize: 15, textAlign: 'center'}}>我是导航功能栏标题</Text>
<Text style={{marginTop: 10,marginLeft:20,color:'#fff',fontSize: 15, textAlign: 'left'}}>1.功能1</Text>
<Text style={{marginTop: 10,marginLeft:20,color:'#fff',fontSize: 15, textAlign: 'left'}}>2.功能2</Text>
</View>
);
return (
<DrawerLayoutAndroid
drawerWidth={200}
drawerPosition={DrawerLayoutAndroid.positions.left}
renderNavigationView={() => navigationView}>
<View style={{flex: 1, alignItems: 'center'}}>
<Text style={{margin: 10, fontSize: 15, textAlign: 'right'}}>我是主布局内容</Text>
</View>
</DrawerLayoutAndroid>
);
}
}
AppRegistry.registerComponent("TestDrawerLayout", () => DrawerLayoutDemo);