android中地图碎片上的黑线显示

android中地图碎片上的黑线显示,android,android-fragments,Android,Android Fragments,我正在Android中开发一个片段。在我的选项卡中有四个片段,其中一个是地图片段 使用此地图片段: <fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent"

我正在Android中开发一个片段。在我的选项卡中有四个片段,其中一个是地图片段

使用此地图片段:

<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" />

这项任务做得很完美


问题是,当用户滑动时,地图片段上会显示一条黑线,持续1秒。我已经在网上研究过了,但是找不到一个方法来阻止它?为什么会发生这种情况?我如何解决它?

也面临着这个奇怪的问题。通过在mapview片段上应用透明视图解决了这个问题,如下所示。这是一种黑客行为,看看对你有用吗

<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>

也面临这个奇怪的问题。通过在mapview片段上应用透明视图解决了这个问题,如下所示。这是一种黑客行为,看看对你有用吗

<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>