简体   繁体   中英

Black line showing on map fragment in android

I am developing a fragment in Android. In my tab there are four fragments, of which one is a map fragment.

Using this map fragment:

<fragment xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/map"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          class="com.google.android.gms.maps.SupportMapFragment" />

the task is done perfectly.

The problem is that when the user swipes, a black line is shown on the map fragment for 1 second. I've researched this online but couldn't find a way to prevent this? Why is this occurring and how can I fix it?

Was also facing this strange issue.Fixed it as follows by applying a transparent View over the mapview fragment seems to resolve the issue. Its a kind of hack.See if it works for you

<RelativeLayout
            android:id="@+id/relativeLayout1"
            android:layout_width="match_parent"
            android:layout_height="300dp" >

            <fragment
                android:id="@+id/map"
                android:name="com.google.android.gms.maps.MapFragment"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"/>

            <View
                android:id="@+id/imageView123"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
               android:background="@android:color/transparent" />         
    </RelativeLayout>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM