重新定位谷歌徽标图形页面徽标、图形、页面

2023-09-04 23:55:28 作者:你在我眼中是最美

我在图形页面的每一个底角的两个按钮,部分模糊的谷歌标志的左下角。

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

为了遵守的条款和API的情况下,我需要谷歌的标志搬迁到什么地方更为明显。即上面的按钮。

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文档指出,谷歌的标志画在图形页面,但我的的OnDraw()方法不知道如何来覆盖它正确,因为谷歌地图是闭源。

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.

我可以通过找到正确的的UIView 的MKMapView的的孩子,但我不这样做在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.

推荐答案

谷歌地图SDK V2为Android添加此功能。

Google Maps SDK v2 for Android adds this functionality.

使用 GoogleMap.setPadding()来添加填充到激活区域(包括谷歌的标志和版权声明),同时还填补了完整的容器。

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