How to make the black background transparent in google map v2 while scrolling?
<RelativeLayout
android:id="@+id/relativeLayout1"
android:layout_width="match_parent"
android:layout_height="134dp"
android:layout_alignParentTop="true"
android:layout_gravity="center" >
<fragment
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map"
android:layout_width="fill_parent"
android:layout_height="434dp"
android:layout_marginBottom="-150dp"
android:layout_marginLeft="3dp"
android:layout_marginRight="3dp"
android:layout_marginTop="-150dp"
class="com.google.android.gms.maps.SupportMapFragment"
android:cacheColorHint="@color/transparent"
android:clickable="true" />
<FrameLayout
android:id="@+id/fram_lay"
android:layout_width="match_parent"
android:layout_height="172dp" >
<android.support.v4.view.ViewPager
android:id="@+id/fragment_container"
android:layout_width="fill_parent"
android:layout_height="134dp" >
</android.support.v4.view.ViewPager>
<FrameLayout
android:id="@+id/fram_lay2"
android:layout_width="match_parent"
android:layout_height="334dp"
android:layout_marginTop="-100dp"
android:background="@android:color/transparent"
android:cacheColorHint="#00000000" />
</FrameLayout>
</RelativeLayout>
I have given transparent frame over map but still it is flickering. please somebody give me a solution thank you
The transparent frame over the MapView will only solve the black hole problem, the flicker will still happen each time the map re-loads it's resources i.e. when OnCreateView()
is called.
Try the solution posted here with adding a MapView in the main Activity and then hiding it once initialized.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With