Commit 3a8fcba0 authored by Qiu Xiang's avatar Qiu Xiang

调整界面

parent 84eb0a46
import {StatusBar} from 'react-native'
import {StackNavigator} from 'react-navigation' import {StackNavigator} from 'react-navigation'
import Examples from './examples' import Examples from './examples'
import MapTypes from './map-types' import MapTypes from './map-types'
...@@ -8,9 +7,6 @@ import Controls from './controls' ...@@ -8,9 +7,6 @@ import Controls from './controls'
import Gestures from './gestures' import Gestures from './gestures'
import Marker from './marker' import Marker from './marker'
StatusBar.setBackgroundColor('#e0e0e0')
StatusBar.setBarStyle('dark-content')
export default StackNavigator({ export default StackNavigator({
Examples: {screen: Examples}, Examples: {screen: Examples},
MapTypes: {screen: MapTypes}, MapTypes: {screen: MapTypes},
......
...@@ -5,28 +5,41 @@ import { ...@@ -5,28 +5,41 @@ import {
ScrollView, ScrollView,
StyleSheet, StyleSheet,
TouchableHighlight, TouchableHighlight,
TouchableNativeFeedback,
Platform,
StatusBar,
} from 'react-native' } from 'react-native'
let Touchable = TouchableHighlight
if (Platform.OS === 'android') {
Touchable = TouchableNativeFeedback
}
export default class Examples extends Component { export default class Examples extends Component {
static navigationOptions = { static navigationOptions = {
title: 'AMap3D Examples', title: 'AMap3D Examples',
} }
_renderItem(title, route) { _renderItem(title, route) {
return <TouchableHighlight onPress={() => this.props.navigation.navigate(route)}> return <Touchable onPress={() => this.props.navigation.navigate(route)}>
<View style={styles.item}> <View style={styles.item}>
<Text style={styles.itemText}>{title}</Text> <Text style={styles.itemText}>{title}</Text>
</View> </View>
</TouchableHighlight> </Touchable>
} }
render() { render() {
return <ScrollView contentContainerStyle={styles.scrollView}> return <ScrollView contentContainerStyle={styles.scrollView}>
<StatusBar barStyle='dark-content' backgroundColor='#e0e0e0'/>
<View style={styles.group}> <View style={styles.group}>
{this._renderItem('地图模式', 'MapTypes')} {this._renderItem('地图模式', 'MapTypes')}
<View style={styles.separator}/>
{this._renderItem('图层功能', 'Layers')} {this._renderItem('图层功能', 'Layers')}
<View style={styles.separator}/>
{this._renderItem('室内地图', 'Indoor')} {this._renderItem('室内地图', 'Indoor')}
<View style={styles.separator}/>
{this._renderItem('地图控件', 'Controls')} {this._renderItem('地图控件', 'Controls')}
<View style={styles.separator}/>
{this._renderItem('手势交互', 'Gestures')} {this._renderItem('手势交互', 'Gestures')}
</View> </View>
<View style={styles.group}> <View style={styles.group}>
...@@ -43,14 +56,14 @@ const styles = StyleSheet.create({ ...@@ -43,14 +56,14 @@ const styles = StyleSheet.create({
}, },
group: { group: {
marginTop: 15, marginTop: 15,
borderTopWidth: StyleSheet.hairlineWidth,
borderTopColor: '#e0e0e0',
}, },
item: { item: {
padding: 15, padding: 15,
backgroundColor: '#fff', backgroundColor: '#fff',
borderBottomWidth: StyleSheet.hairlineWidth, },
borderBottomColor: '#e0e0e0', separator: {
height: StyleSheet.hairlineWidth,
backgroundColor: '#e0e0e0',
}, },
itemText: { itemText: {
fontSize: 16, fontSize: 16,
......
...@@ -23,7 +23,7 @@ export default class Layers extends Component { ...@@ -23,7 +23,7 @@ export default class Layers extends Component {
value={this.state.showsBuildings}/> value={this.state.showsBuildings}/>
</View> </View>
<View style={styles.control}> <View style={styles.control}>
<Text>交通</Text> <Text>路况</Text>
<Switch <Switch
onValueChange={showsTraffic => this.setState({showsTraffic})} onValueChange={showsTraffic => this.setState({showsTraffic})}
value={this.state.showsTraffic}/> value={this.state.showsTraffic}/>
......
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