【发布时间】:2014-04-11 18:57:47
【问题描述】:
我在RelativeLayout 中显示GoogleMap,并在上方显示TextView(除其他外):
<RelativeLayout
width=match_parent
height=match_parent>
<Map
width=match_parent
height=match_parent />
<TextView
with=100dp
height=100dp />
</RelativeLayout>
出于某种原因,如果我回到家,然后重新打开应用程序,地图将覆盖(覆盖)TextView。
我尝试使用SupportMapFragment 和MapView(与zOrderOnTop="false")但没有效果。
我也尝试在onResume/onPause中显示/隐藏地图,没有效果。
我也有Drawer issue,但建议的修复只解决了Drawer 问题。
版本:
com.google.android.gms:play-services:4.2.+
compileSdkVersion 19
minSdkVersion 14
targetSdkVersion 14.
注意:此问题仅在三星 Galaxy SII (4.0.4) 上出现。 任何想法?谢谢。
更新:我也尝试从代码中扩充Fragment 而不是XML,或者使用GoogleMapOptions 设置zOrderOnTop(false),结果还是一样...
更新 2:我想我缩小了问题范围:
工作:
抽屉.xml
<Drawer>
<RelativeLayout
width=match_parent
height=match_parent>
<RelativeLayout
width=match_parent
height=match_parent>
<Map
width=match_parent
height=match_parent>
<View
width=match_parent
height=match_parent
background=transparent>
</RelativeLayout>
<TextView
width=100dp
height=100dp>
</RelativeLayout>
<ListView /> <!-- menu -->
</Drawer>
不工作:
抽屉.xml
<Drawer>
<FrameLayout /> <!-- fragment container -->
<ListView /> <!-- menu -->
</Drawer>
map.xml
<RelativeLayout
width=match_parent
height=match_parent>
<RelativeLayout
width=match_parent
height=match_parent>
<Map
width=match_parent
height=match_parent>
<View
width=match_parent
height=match_parent
background=transparent>
</RelativeLayout>
<TextView
width=100dp
height=100dp>
</RelativeLayout>
一种解决方案是在drawer.xml 中声明地图,然后在需要时使用setVisibility 显示/隐藏它...有更好的建议吗?
【问题讨论】:
标签: android google-maps overlay google-maps-android-api-2