更改 MapView 中的缩放控件
我想更改应用程序中缩放控件的预定义样式,使其看起来像谷歌地图应用程序中的新缩放控件。参见下文:
我该怎么做?我环顾四周,没有发现任何东西。
提前致谢。
I would like to change the predefined style of the zoom controls in my application to appear like the new zoom controls in the google maps application. See below:
How can I do it? I have been looking around and I haven't found anything.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该有四个图像可绘制对象,即:
将它们放入
MapView
布局中一个带有背景图像的ImageView
或Button
,如上面的可绘制对象。然后你应该分配 onClickListeners 像:
编辑:
You should have four image drawables namely:
Put them in
MapView
layout anImageView
orButton
with background image as the above drawables.Then you should assign onClickListeners like:
EDIT:
我这样解决了问题:禁用内置缩放控件(
setBuiltInZoomControls(false)
),将我自己的按钮添加到 UI 并添加单击按钮的处理程序事件。I solved the problem this way: disabled built in zoom controls (
setBuiltInZoomControls(false)
), added my own buttons to UI and added handlers for click on button events.