本文介绍了Android的:如何设置ImageView的在谷歌地图API的Andr​​oid的标志?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到现在我是用绘制填充标记在我的地图。现在我想知道这将是冷静,如果我能显示自定义的ImageView作为地图标记。

till now i was using drawable to populate marker on my map .Now i was wondering it would be cool if i could display custom imageview as a marker in map.

到现在我正在做它像

      itemized= new Itemazide(drawable, mContext);

我想实现像

推荐答案

是啊,我,不知道我能不能做这样的事情,即显示一个定制查看代替绘。您可以覆盖平局()方法,但不幸的是它总是(有人告诉我,我错了)必须绘制。我想这是因为自定义的查看将采取太多内存。

Yeah I was wondering if I could do something like this, i.e. show a custom View instead of drawable. You can override draw() method, but unfortunately it always (someone please tell me I'm wrong) has to be drawable. I think it's because custom View would take too much memory.

话虽这么说,这取决于你想要达到它可能可以破解库来实现一些类似的效果。

That being said, depending on what you're trying to achieve it's probably possible to hack mapview-baloon library to achieve some similar effect.

编辑:
现在,你已经表明你想达到什么样的,我认为你应该重写画() OverlayItem 在这种方法夸大你的的ImageView 。但我并没有试图做这种方式,所以可能有一些缺点(我记得有一个SO线程上声称类似的事情,它会打断这一切的触摸事件 OverlayItem )。

Now that you've shown what you're trying to achieve I think you should override draw() in your OverlayItem and in this method inflate your ImageView. But I didn't try to do it this way, so there may be some drawbacks (I remember a SO thread on a similar matter that claimed, that it would interrupt all touch events on this OverlayItem).

这篇关于Android的:如何设置ImageView的在谷歌地图API的Andr​​oid的标志?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-31 12:14