React native 如何更改本地地图中标记的大小?
我正试图缩小地图上的标记的大小,因为它太大了 问题是在这种情况下,使用style={}似乎不起作用 我错过了什么React native 如何更改本地地图中标记的大小?,react-native,maps,android-mapview,React Native,Maps,Android Mapview,我正试图缩小地图上的标记的大小,因为它太大了 问题是在这种情况下,使用style={}似乎不起作用 我错过了什么 <MapView.Marker coordinate={{ latitude: 52.78825, longitude: 13.4324 }} title="This should be me" description="Some description" image={require('../assets/
<MapView.Marker
coordinate={{ latitude: 52.78825, longitude: 13.4324 }}
title="This should be me"
description="Some description"
image={require('../assets/icon.png')}
style={{width: 26, height: 28}}
>
您可以按照以下文档以这种方式呈现标记:
我尝试过这种方法,它根本不显示图像,只显示默认标记。这就是我最终使用上述代码的原因。@YahirCasas你能试试我更新的答案吗?这对我来说是有效的。它不起作用:(图像看起来像往常一样大。唯一改变的是,我现在收到一条警告,上面写着“无法激活KeepAwake”。它对我有效,但是为了保持正确的坐标,我必须通过resizeMode=“center”
和resizeMethod=“resize”
至图像
组件。
<Marker ...>
<Image
source={require('../assets/icon.png')}
style={{width: 26, height: 28}}
resizeMode="contain"
/>
</Marker>