react-native(리액트 네이티브) component - Slider
import React, {Component} from 'react';
import {
View,
Text,
Slider,
ScrollView,
StyleSheet,
} from 'react-native';
export default class extends Component {
constructor(props) {
super(props);
this.state = {
value : 1
}
}
render() {
return (
<ScrollView style={styles.Contents}>
<Slider
minimumValue={1}
maximumValue={100}
step={1}
onValueChange={(value) => this.setState({value: value})}
/>
<View style={styles.Box}>
<Text>Value : {this.state.value} (1~100)</Text>
</View>
</ScrollView>
)
}
}
const styles = StyleSheet.create({
Contents : {
flex : 1,
padding:10
},
Box : {
margin: 10,
padding: 10,
borderWidth: 1,
alignItems: "center"
}
})
'프로그래밍(Programming) > 리액트 네이티브(React Native)' 카테고리의 다른 글
react-native(리액트 네이티브) component - Switch (0) | 2019.01.07 |
---|---|
react-native(리액트 네이티브) component - StatusBar (0) | 2019.01.07 |
react-native(리액트 네이티브) component - SectionList (0) | 2019.01.07 |
react-native(리액트 네이티브) component - ScrollView (0) | 2019.01.07 |
react-native(리액트 네이티브) component - RefreshControl (0) | 2019.01.07 |