gpt4 book ai didi

android - 在谷歌地图上方显示工具栏

转载 作者:行者123 更新时间:2023-11-29 20:00:54 25 4
gpt4 key购买 nike

我在将工具栏置于谷歌地图上方时遇到了麻烦。

我遵循了在线指示,但是当我启动代码时,我看不到工具栏。

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

最佳答案

我根据 JPCrow 输入更正了代码:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="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:background="@color/SecondaryBackground"
tools:context="com.example.filippo.xxx.MainActivity"
>


<include android:id="@+id/app_bar" layout="@layout/toolbar"/>


<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.filippo.xxx.homemap"
/>

</RelativeLayout>

现在可以了。谢谢。

关于android - 在谷歌地图上方显示工具栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36298502/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com