4
我試圖在<MapView>
上添加<Image>
。應該是這個樣子 -在另一個頂部覆蓋或添加視圖:React Native
這裏是我的代碼 -
<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
只有地圖可見@Cherniv – shubhsin