安卓:谷歌地图API - 地图工具栏的改变位置 [英] Android: Google Maps API - Change position of maps toolbar

查看:434
本文介绍了安卓:谷歌地图API - 地图工具栏的改变位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是Android版谷歌地图API。下面code可以使在右下角的地图工具栏,当我点击一个标记

I'm using the Google Maps API for Android. The following code enables the maps toolbar in the bottom right corner when I click on a Marker

googleMap.getUiSettings().setMapToolbarEnabled(true); 

不过,我想这个映射工具栏出现在地图的右上角,而不是默认的右下角位置。

However, I'd like this maps toolbar to appear in the TOP RIGHT corner of the map, rather than the default bottom right position.

我将如何做到这一点?

推荐答案

评论的思想,但低信誉。所以:

Thought of commenting, But has low reputation. So:

据我所知,目前还没有办法对其进行定位的现在。它会出现在只有它的默认位置。

As far as I know, there is no way to position it for now. It'll appear at its default position only.

随着内森说,如果可能,我要补充一些替代。所以,有一种解决方法:您可以禁用地图上的工具栏。并能在布局任意位置添加appcompact的工具栏。

As Nathan said I should add some alternative if possible. So,There is a work around: You can disable the map's toolbar. and can add appcompact's ToolBar anywhere in the layout.

参考:<一href="https://developer.android.com/reference/android/support/v7/widget/Toolbar.html">https://developer.android.com/reference/android/support/v7/widget/Toolbar.html

这篇关于安卓:谷歌地图API - 地图工具栏的改变位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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