【发布时间】:2017-04-16 04:53:52
【问题描述】:
我正在尝试使用react-native-maps 解决红色边框问题。我已经尝试了所有常用的样式设置、重新安装/重新链接以及将空中地图添加到我的 xcode 项目中,我没有尝试使用谷歌地图。任何帮助将不胜感激。
import React, { Component } from 'react';
import {
Dimensions,
StyleSheet,
View,
} from 'react-native';
import MapView from 'react-native-maps';
const { width, height } = Dimensions.get('window');
const styles = StyleSheet.create({
container: {
...StyleSheet.absoluteFillObject,
justifyContent: 'flex-end',
alignItems: 'center',
},
map: {
...StyleSheet.absoluteFillObject,
width: width,
height: height,
},
});
export default class Map extends Component {
render(){
const { container, map } = styles;
return(
<View style={container}>
<MapView
style={map}
initialRegion={{
latitude: 37.78825,
longitude: -122.4324,
latitudeDelta: 0.0922,
longitudeDelta: 0.0421,
}}
showUserLocation
/>
</View>
);
}
};
【问题讨论】:
-
什么是“红色边框问题”?地图实际上是用红色边框渲染的,还是只得到一个空的红色矩形?
-
带红色边框的空框
标签: ios react-native maps react-native-maps