1
1
import React , { Component } from 'react' ;
2
- import { Platform , StyleSheet , Text , View , TouchableOpacity } from 'react-native' ;
2
+ import { Platform , StyleSheet , Text , View , Button } from 'react-native' ;
3
3
import NavbarStyle from 'react-native-navbar-style' ;
4
- const instructions = Platform . select ( {
5
- ios : 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu' ,
6
- android :
7
- 'Double tap R on your keyboard to reload,\n' +
8
- 'Shake or press menu button for dev menu' ,
9
- } ) ;
4
+
10
5
11
6
export default class App extends Component {
12
7
13
- setLightbar = ( ) => {
14
- NavbarStyle . setLightNavbar ( true ) ;
8
+ setLightbar = async ( ) => {
9
+ await NavbarStyle . setLightNavbar ( true ) ;
15
10
}
16
- setDarkbar = ( ) => {
17
- NavbarStyle . setLightNavbar ( false ) ;
11
+ setDarkbar = async ( ) => {
12
+ await NavbarStyle . setLightNavbar ( false ) ;
18
13
}
19
14
20
15
onChangeNavBarColor = ( ) => {
@@ -27,9 +22,9 @@ export default class App extends Component {
27
22
return (
28
23
< View style = { styles . container } >
29
24
< Text style = { styles . welcome } > NavbarStyles</ Text >
30
- < TouchableOpacity onPress = { this . setLightbar } > < Text > Set Light Navbar </ Text > </ TouchableOpacity >
31
- < TouchableOpacity onPress = { this . setDarkbar } > < Text > Set Dark Navbar </ Text > </ TouchableOpacity >
32
- < TouchableOpacity onPress = { this . onChangeNavBarColor } > < Text > Change Color </ Text > </ TouchableOpacity >
25
+ < Button title = "Set Light Navbar" onPress = { this . setLightbar } / >
26
+ < Button title = "Set Dark Navbar" onPress = { this . setDarkbar } / >
27
+ < Button title = "Change Color" onPress = { this . onChangeNavBarColor } / >
33
28
</ View >
34
29
) ;
35
30
}
@@ -40,6 +35,7 @@ const styles = StyleSheet.create({
40
35
flex : 1 ,
41
36
justifyContent : 'center' ,
42
37
alignItems : 'center' ,
38
+ justifyContent : 'space-evenly' ,
43
39
backgroundColor : '#F5FCFF' ,
44
40
} ,
45
41
welcome : {
0 commit comments