我在一家RelativeLayout
顯示GoogleMap
,具有TextView
(除其他事項外)結束:Android的GoogleMap的重疊次數的onResume
<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
/上顯示/隱藏地圖,沒效果。
我也有Drawer
issue,但建議的修復只解決了Drawer
問題。
版本: com.google.android.gms:play-services:4.2.+
compileSdkVersion 19
minSdkVersion 14
targetSdkVersion 14
。
注意:此問題僅發生在Samsung Galaxy SII(4.0.4)上。 有什麼想法?謝謝。
更新:我也試圖從膨脹的代碼,而不是XML的Fragment
,或使用GoogleMapOptions
設置zOrderOnTop(false)
,還是同樣的結果...
更新2:我想我收窄問題:
工作:
drawer.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>
不工作:
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
顯示/隱藏在需要的時候...有什麼更好的建議?
謝謝,但我已經嘗試過。它只修復抽屜問題,而不是主要問題...... – mbmc