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"
}
})


+ Recent posts