【问题标题】:React Native Maps : moving myLocationButtonReact Native Maps:移动 myLocationButton
【发布时间】:2020-09-03 15:12:11
【问题描述】:

有没有办法移动 MyLocationButton 的位置? 我正在使用带有一些附加视图的 Mapview。其中一个视图位于 MyLocationButton 之上,从美学上讲,我希望保持这种状态 --> 所以我应该移动 MyLocationButton。有没有办法做到这一点? x

<MapView
        style={styles.map}
        showsMyLocationButton = {true}
        showsUserLocation = {true}
        provider={PROVIDER_GOOGLE}
        customMapStyle={mapStyle}
        initialRegion={{
          latitude: this.state.mylocation.coords.latitude,
          longitude: this.state.mylocation.coords.longitude,
          latitudeDelta: 0.0922,//Zoom
          longitudeDelta: 0.0421,//Zoom
        }}>

【问题讨论】:

  • 使用绝对位置制作自定义位置按钮

标签: react-native google-maps expo react-native-maps


【解决方案1】:

如果它对某人有帮助,我找到了在地图继续覆盖整个屏幕时移动按钮位置的解决方案:

<MapView
(...)
        mapPadding={{top:0, right:0, left:0, bottom:230}}>
(...)
</Mapview>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-11-04
    • 1970-01-01
    • 2017-10-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-21
    相关资源
    最近更新 更多