【发布时间】:2016-05-26 11:01:19
【问题描述】:
我正在尝试在 <MapView> 上添加 <Image>。应该看起来像这样 -
这是我的代码 -
<MapView
mapType='standard'
style={styles.map}
region={{
latitude: selectedLoc.location.latitude,
longitude: selectedLoc.location.longitude,
latitudeDelta: 0.005,
longitudeDelta: 0.005
}}
onRegionChange={() => { } }
onRegionChangeComplete={() => { } }
showsUserLocation={false}
zoomEnabled={false}
draggable={false}
annotations={[{
longitude: selectedLoc.location.latitude,
latitude: selectedLoc.location.longitude,
title: selectedLoc.title
}]}
initialRegion={{
latitude: selectedLoc.location.latitude,
longitude: selectedLoc.location.longitude
}}>
<Image
style={{
width: 50,
height: 50,
}}
resizeMode={"contain"}
source={{ uri: 'https://unsplash.it/50/50/?random' }}
/>
</MapView>
我没有从这段代码中得到任何关于顶部的视图。请告诉我
【问题讨论】:
-
现在怎么样了?可以附上截图吗?
-
只有地图可见@Cherniv
-
嗨@shubhsin,你有解决方案吗?
标签: android ios reactjs react-native