如何重新定位内置变焦控制在图形页面? [英] How to reposition built-in zoom controls in MapView?

查看:124
本文介绍了如何重新定位内置变焦控制在图形页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要把内置的图形页面的缩放控制到位,从默认的位置不同。 虽然很容易使用getZoomControls()方法来完成,这种方法是pcated在最近的API版本去$ P $。

I need to place built-in zoom controls of MapView into position different from the default position. While it's easy to do using getZoomControls() method, this method is deprecated in recent API versions.

有没有人有想法如何做到这一点的调用getZoomControls()?

Does anyone has idea how to do this without calling getZoomControls()?

推荐答案

我有一个答案。我设法与这code在左下角,而不是在中间

I have an answer to this. I managed to reposition it with this code in the bottom left corner instead of in the middle

FrameLayout.LayoutParams zoomParams = new FrameLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
ZoomControls controls = (ZoomControls) getZoomButtonsController().getZoomControls();
controls.setGravity(Gravity.LEFT);
controls.setLayoutParams(zoomParams);

这篇关于如何重新定位内置变焦控制在图形页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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