1
Ich habe Probleme, eine Symbolleiste über die Google-Karte zu setzen.Symbolleiste über Google-Karte anzeigen
Ich folgte einer Online-Anzeige, aber wenn ich den Code starte, kann ich die Symbolleiste nicht sehen.
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
xmlns:sothree="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/app_bar"
android:layout="@layout/toolbar"
android:layout_height="match_parent"
android:layout_width="match_parent"/>
<fragment
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/map"
android:layout_below="@+id/app_bar"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.namexxx.app.homemap"
/>
</FrameLayout>
Ok, zuerst verwenden Sie ein framelayout und dann das Fragment: android: layout_below = "@ + id/app_bar" Verwenden Sie ein relatives Layout anstelle von FrameLayout. Außerdem können Sie die Höhe der Symbolleiste wie folgt ändern: android: layout_height = "wrap_content" android: minHeight = "? Attr/actionBarSize" – JpCrow