我正在尝试在
<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>
我在这段代码中没有得到任何视图。请告诉我原因。