2013-04-08 35 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上正常工作而不会出现任何问题。 (