MapView V2 in a ScrollView draws itself over the ActionBar

醉酒当歌 提交于 2019-12-11 12:38:51

问题


So, all bad things in the title aside, I've got a MapView (and a few other Views) inside of a ScrollView (I know, and I've advised a thousand times against putting a MapView in a scrolling container but this is what the client wants) and when I scroll the ScrollView up the MapView ends up drawing over the ActionBar. I set the zOrderOnTop to true on the GoogleMapOptions that I pass to the constructor of MapView which prevents this from happening when I first add the MapView to the view hierarchy, but when I navigate away and come back to the app the map is drawn over the ActionBar again.

I have to artificially call the MapView lifecycle events when the MapView is created and placed into the ScrollView because I make a network call, and depending on the data I may or may not need to add a map.

I've been searching on Google and SO for ways to mitigate this and I've come up with nothing. The phones I'm testing on are Android 4.1+ so it should be using the TextureView implementation and not the SurfaceView implementation of MapView.

来源:https://stackoverflow.com/questions/18927354/mapview-v2-in-a-scrollview-draws-itself-over-the-actionbar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!