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

时间:2016-03-30 02:19:53

标签: android android-layout android-toolbar

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

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

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

1 个答案:

答案 0 :(得分:2)

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

$('td img').click(function(){
    var index = $(this).parent().index();
});

现在它有效。感谢。