如何different- 2位显示吐司 [英] How to display Toast in different- 2 position
本文介绍了如何different- 2位显示吐司的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的地图活动显示叠加,当我敲击覆盖图标,然后举杯被显示在屏幕底部的N多,但我想通过覆盖图标在那里我攻。
My map activity displaying n number of overlay, when i am tapping on overlay icon then toast is displaying on bottom of screen, But i want to display the Toast near by overlay icon where i am tapping..
请指引我,在此先感谢...
Please guide me, Thanks in advance...
推荐答案
这code是给我敬酒的确切位置... 这code是给我敬酒的确切比重。
This code is giving me exact position of toast... This code is giving me exact gravity of toast..
OverlayItem item = overlayItems_.get(index);
Projection projection = mMapView.getProjection();
Point point = new Point();
projection.toPixels(item.getPoint(), point);
Toast toast = Toast.makeText(mContext, item.getTitle()+" "+item.getSnippet(), Toast.LENGTH_SHORT);
toast.setGravity(Gravity.TOP | Gravity.LEFT, point.x, point.y);
toast.show();
下面我传递点也..
这篇关于如何different- 2位显示吐司的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文