1

我正在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 秒。我已经在网上研究过,但找不到防止这种情况的方法?为什么会发生这种情况,我该如何解决?

4

1 回答 1

10

也面临这个奇怪的问题。通过在地图视图片段上应用透明视图来修复它似乎解决了这个问题。它是一种黑客。看看它是否适合你

<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>
于 2013-02-18T17:28:50.763 回答