Ich entwickle ein Fragment in Android. In meinem Tab befinden sich vier Fragmente, von denen eines ein Kartenfragment ist.
Verwenden dieses Kartenfragments:
<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" />
Die Aufgabe ist perfekt erledigt.
Das Problem ist, dass wenn der Benutzer wischt, ein schwarzesDie Linie wird 1 Sekunde lang auf dem Kartenfragment angezeigt. Ich habe das online recherchiert, konnte aber keinen Weg finden, das zu verhindern. Warum passiert das und wie kann ich es beheben?
Antworten:
10 für die Antwort № 1War auch mit diesem seltsamen Problem konfrontiert.Fixed es wie folgt, indem Sie eine transparente View über das Mapview-Fragment scheint das Problem zu lösen. Es ist eine Art Hack. Sehen Sie, ob es für Sie funktioniert
<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>