在 MapView 中重新定位 Google 徽标 [英] Relocate Google logo in MapView

查看:25
本文介绍了在 MapView 中重新定位 Google 徽标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 MapView 的每个底角都有两个按钮,部分遮挡了左下角的 google 徽标.

I have two buttons at each bottom corners of the MapView, partly obscuring the google logo in the bottom-left corner.

为了遵守 API 的条款和条件,我需要将 google 徽标重新定位到更显眼的地方.即在按钮上方.

In order to comply with the terms and conditions of the API, I need to relocate the google logo to somewhere more visible. i.e. above the button.

谷歌 API 文档指出谷歌徽标是在 MapViewonDraw() 方法中绘制的,但我不知道如何正确覆盖它,因为谷歌地图是闭源.

The google API doc states that the google logo is drawn in the onDraw() method of MapView but I have no idea how to override it properly since google maps is closed source.

我可以通过在 MKMapView's 子项中找到正确的 UIView 来在 iPhone 中做到这一点,但我不知道如何在 Android 中做到这一点.

I could do this in iPhone by finding the correct UIView in the MKMapView's children but I can't figure out how I could do this in Android.

推荐答案

Android 版 Google Maps SDK v2 添加了此功能.

Google Maps SDK v2 for Android adds this functionality.

使用 GoogleMap.setPadding() 将填充添加到活动"区域(包括 Google 徽标和版权声明),同时仍然填充整个容器.

Use GoogleMap.setPadding() to add padding to the "active" area (including the Google logo and copyright notices) while still filling the full container.

https://developers.google.com/maps/documentation/android/map#map_padding

这篇关于在 MapView 中重新定位 Google 徽标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆