-
Notifications
You must be signed in to change notification settings - Fork 20
/
App.js
45 lines (41 loc) · 1.09 KB
/
App.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
37
38
39
40
41
42
43
44
45
import React, { Component } from 'react'
import { StyleSheet, View } from 'react-native'
import { Picker } from 'react-native-picker-dropdown'
export default class App extends Component {
constructor(props, context) {
super(props, context)
this.state = { language: 'js' }
this.onValueChange = this.handleValueChange.bind(this)
}
handleValueChange(language) {
this.setState({ language })
}
render() {
return (
<View style={styles.container}>
<Picker
selectedValue={this.state.language}
onValueChange={this.onValueChange}
mode="dialog"
textStyle={styles.pickerText}
>
<Picker.Item label="JavaScript" value="js" />
<Picker.Item label="Ruby" value="ruby" />
<Picker.Item label="Python" value="python" />
<Picker.Item label="Elm" value="elm" />
</Picker>
</View>
)
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
pickerText: {
color: 'black',
}
})