在 MapView 上叠加静态图像
我仍然是 Android 新手,但一直在寻找问题的答案,但没有成功。
我有一个用户可以完全操作(滚动、放大等)的地图视图,但我需要让用户知道地图的中点在哪里。我想为此使用一个小的“十字准线”图像,并在任何时间和所有放大级别将其显示在地图的中心。事实上,我只是希望图像始终处于可见状态。我能找到办法做到这一点吗?我能见鬼吗!
我确信你们中的一两位专家有一个非常简单的解决方案。请帮忙。
托尼
I'm still a newbie to Android but have searched high and low for an answer to my problem without success.
I have a map view that the user can fully manipulate (scroll, enlarge etc.) but I need to let the user know where the midpoint of the map is. I want to use a small "crosshair" image for this and display it at the centre of the map AT ALL TIMES and AT ALL LEVELS OF MAGNIFICATION. In fact, I just want the image to remain on view at all times. Can I find a way to do this? Can I hell!
I'm sure there is a very simply solution to this from one or two of you gurus out there. Please help.
Tony
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在包含 MapView 的布局文件中,确保布局容器的类型为relativelayout。然后简单地将ImageView添加为RelativeLayout的子级,属性为layout_gravity =“center”
基本上,研究RelativeLayout。
In your layout file that contains the MapView, make sure that the Layout container is of type RelativeLayout. Then simply add the ImageView as a child of the RelativeLayout, with an attribute of layout_gravity="center"
Basically, research RelativeLayout.