Commit d732554b authored by Qiu Xiang's avatar Qiu Xiang

优化示例界面

parent 51199952
...@@ -20,24 +20,28 @@ export default class Controls extends Component { ...@@ -20,24 +20,28 @@ export default class Controls extends Component {
<View style={styles.control}> <View style={styles.control}>
<Text>指南针</Text> <Text>指南针</Text>
<Switch <Switch
style={styles.switch}
onValueChange={showsCompass => this.setState({showsCompass})} onValueChange={showsCompass => this.setState({showsCompass})}
value={this.state.showsCompass}/> value={this.state.showsCompass}/>
</View> </View>
<View style={styles.control}> <View style={styles.control}>
<Text>比例尺</Text> <Text>比例尺</Text>
<Switch <Switch
style={styles.switch}
onValueChange={showsScale => this.setState({showsScale})} onValueChange={showsScale => this.setState({showsScale})}
value={this.state.showsScale}/> value={this.state.showsScale}/>
</View> </View>
<View style={styles.control}> <View style={styles.control}>
<Text>定位</Text> <Text>定位</Text>
<Switch <Switch
style={styles.switch}
onValueChange={showsLocationButton => this.setState({showsLocationButton})} onValueChange={showsLocationButton => this.setState({showsLocationButton})}
value={this.state.showsLocationButton}/> value={this.state.showsLocationButton}/>
</View> </View>
<View style={styles.control}> <View style={styles.control}>
<Text>缩放</Text> <Text>缩放</Text>
<Switch <Switch
style={styles.switch}
onValueChange={showsZoomControls => this.setState({showsZoomControls})} onValueChange={showsZoomControls => this.setState({showsZoomControls})}
value={this.state.showsZoomControls}/> value={this.state.showsZoomControls}/>
</View> </View>
...@@ -58,7 +62,7 @@ const styles = StyleSheet.create({ ...@@ -58,7 +62,7 @@ const styles = StyleSheet.create({
flex: 1, flex: 1,
}, },
controls: { controls: {
height: 54, height: 72,
backgroundColor: '#fff', backgroundColor: '#fff',
flexDirection: 'row', flexDirection: 'row',
justifyContent: 'space-between', justifyContent: 'space-between',
...@@ -67,7 +71,10 @@ const styles = StyleSheet.create({ ...@@ -67,7 +71,10 @@ const styles = StyleSheet.create({
paddingRight: 20, paddingRight: 20,
}, },
control: { control: {
flexDirection: 'row',
alignItems: 'center', alignItems: 'center',
justifyContent: 'center',
},
switch: {
marginTop: 5,
}, },
}) })
...@@ -20,24 +20,28 @@ export default class Gestures extends Component { ...@@ -20,24 +20,28 @@ export default class Gestures extends Component {
<View style={styles.control}> <View style={styles.control}>
<Text>旋转</Text> <Text>旋转</Text>
<Switch <Switch
style={styles.switch}
onValueChange={rotateEnabled => this.setState({rotateEnabled})} onValueChange={rotateEnabled => this.setState({rotateEnabled})}
value={this.state.rotateEnabled}/> value={this.state.rotateEnabled}/>
</View> </View>
<View style={styles.control}> <View style={styles.control}>
<Text>滑动</Text> <Text>滑动</Text>
<Switch <Switch
style={styles.switch}
onValueChange={scrollEnabled => this.setState({scrollEnabled})} onValueChange={scrollEnabled => this.setState({scrollEnabled})}
value={this.state.scrollEnabled}/> value={this.state.scrollEnabled}/>
</View> </View>
<View style={styles.control}> <View style={styles.control}>
<Text>缩放</Text> <Text>缩放</Text>
<Switch <Switch
style={styles.switch}
onValueChange={zoomEnabled => this.setState({zoomEnabled})} onValueChange={zoomEnabled => this.setState({zoomEnabled})}
value={this.state.zoomEnabled}/> value={this.state.zoomEnabled}/>
</View> </View>
<View style={styles.control}> <View style={styles.control}>
<Text>倾斜</Text> <Text>倾斜</Text>
<Switch <Switch
style={styles.switch}
onValueChange={tiltEnabled => this.setState({tiltEnabled})} onValueChange={tiltEnabled => this.setState({tiltEnabled})}
value={this.state.tiltEnabled}/> value={this.state.tiltEnabled}/>
</View> </View>
...@@ -57,7 +61,7 @@ const styles = StyleSheet.create({ ...@@ -57,7 +61,7 @@ const styles = StyleSheet.create({
flex: 1, flex: 1,
}, },
controls: { controls: {
height: 54, height: 72,
backgroundColor: '#fff', backgroundColor: '#fff',
flexDirection: 'row', flexDirection: 'row',
justifyContent: 'space-between', justifyContent: 'space-between',
...@@ -66,7 +70,11 @@ const styles = StyleSheet.create({ ...@@ -66,7 +70,11 @@ const styles = StyleSheet.create({
paddingRight: 20, paddingRight: 20,
}, },
control: { control: {
flexDirection: 'row',
alignItems: 'center', alignItems: 'center',
justifyContent: 'center',
},
switch: {
marginTop: 5,
}, },
}) })
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment