Java – Android: can I draw a view on MapView as a overlay

In fact, the subject is a problem

I want to draw a view on the map as a overlay, but my view contains a linear layout of 9 patch background and two internal textviews I need to draw these layouts at runtime, and they will be linked to geographic locations

There is no problem defining such a view, but there is a problem creating a overlay that can handle this painting

Solution

Yes – that's what FrameLayout is for! The sub items in FrameLayout overlap each other, the last item is displayed at the top and the first item is displayed at the bottom

Take MapView as the first child of FrameLayout and LinearLayout as the second child

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>