2013-04-08 57 views
1

我在PopupWindow中使用了Google Maps(V2),當我運行該應用程序時,地圖不顯示。即使它應該是完全透明的區域,我可以通過它看到PopupWindow以下的活動。PopupWindow透明Google地圖?

任何想法,爲什麼這是?

片段內popup_window.xml

<fragment 
    android:id="@+id/popup_alert_map" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:layout_below="@+id/popup_alert_description" 
    android:layout_marginTop="10dp" 
    class="com.google.android.gms.maps.SupportMapFragment" /> 

我該如何證明它裏面Popup.java

SupportMapFragment supportMapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.popup_alert_map); 
locationMap = supportMapFragment.getMap(); 

locationMap.setMyLocationEnabled(true); 
locationMap.setMapType(GoogleMap.MAP_TYPE_NORMAL); 

我還有一個Activity與地圖它並顯示器很好。

任何幫助,不勝感激...

回答

0

如果您使用的是SupportMapFragment,那麼你應該使用SupportFragmentManager,就像這樣:

locationMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.popup_alert_map)).getMap(); 

試試這個,告訴我結果是什麼。

+0

沒有,仍然是一樣的...... :( – Roshnal 2013-04-08 08:45:17

+0

你有錯誤按摩嗎? – 2013-04-08 09:19:02

+1

不是,沒有錯誤只有地圖應該是完全透明的區域 - 我可以看到PopupWindow的另一面。 – Roshnal 2013-04-08 09:47:52

0

這似乎是一個錯誤,在Android或在MapFragment/SupportMapFragment。我嘗試了同樣的事情(在PopupWindow中添加Google地圖片段)和Google Nexus 10與Android 4.4,地圖上出現PopupWindow就好了,但在Android 4.0.3的較舊設備上,它顯示透明度問題。

最終我所做的只是將它移動到另一個Activity。我尋找儘可能多的方法來修復它,但這一切似乎都是死路一條,特別是考慮到它可以在最新版本的Android上正常工作而不會出現任何問題。 (