Viewpager with Google Maps API V2: Mysterious Black View

ViewPager with Google Maps API v2: mysterious black view

I was able to stop the black surface being left behind after transition by placing another view with a transparent background on top of the ViewPager inside a FrameLayout:

<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >

<android.support.v4.view.ViewPager
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</android.support.v4.view.ViewPager>

<!-- hack to fix ugly black artefact with maps v2 -->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent" />

</FrameLayout>

Blank google map when using it inside multiple fragments on a viewpager

If you want to put a fragment into an other fragment, use getChildFragmentManager() instead of getSupportFragmentManager()

getChildFragmentManager

Return a private FragmentManager for placing and managing Fragments
inside of this Fragment.



Related Topics



Leave a reply



Submit