如何通过谷歌地图添加布局? [英] How to add layout over google maps?

查看:178
本文介绍了如何通过谷歌地图添加布局?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序有一个谷歌地图,当用户点击一个引脚特定的布局将显示酷似SncakBar上,布局包含了一些按钮和TextViews。请帮我,我怎么可以添加布局在谷歌地图。
主要布局的XML文件:

In my application there is a google map, When user clicks on a pin a specific layout will display exactly like SncakBar, Layout contains some Buttons and TextViews. Please help me how can I add layout over google map. XML file of Main layout:

<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">

<android.support.v7.widget.Toolbar
    xmlns:android="http://schemas.android.com/apk/res/android"
    style="@style/ToolBarStyle"
    android:id="@+id/toolbar_actionbar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="?attr/colorPrimary"
    android:elevation="12dp"
    android:minHeight="@dimen/abc_action_bar_default_height_material" />

<android.support.v4.widget.DrawerLayout
    android:id="@+id/drawer"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_below="@+id/toolbar_actionbar">

    <FrameLayout
        android:id="@+id/container"
        android:layout_width="match_parent"
        android:clickable="true"
        android:layout_height="match_parent" >
    </FrameLayout>

    <!--&lt;!&ndash; android:layout_marginTop="?android:attr/actionBarSize"&ndash;&gt;-->
    <fragment android:id="@+id/fragment_drawer"
        android:name="com.example.muhammad.shopplus.NavigationDrawerFragment"
        android:layout_width="@dimen/navigation_drawer_width"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        app:layout="@layout/fragment_navigation_drawer" />

    <FrameLayout
        android:id="@+id/container_"
        android:layout_width="match_parent"
        android:clickable="true"
        android:layout_height="match_parent" >
    </FrameLayout>

    <fragment
        android:id="@+id/map"
        android:name="com.google.android.gms.maps.SupportMapFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        />


</android.support.v4.widget.DrawerLayout>

先谢谢了。

推荐答案

您可以通过使用的FrameLayout或您当前布局中创建在屏幕底部的额外的布局。在开始的时候,这将是不可见的。当用户preSS某处,这将是在底部可见。这是我的建议。你可以尝试,如果它的工作原理。

You can create a extra layout at the bottom of the screen by using Framelayout or inside of your current layout. At the beginning, it will be invisible. When user press somewhere, it will be visible at the bottom. This is my suggestions. You can try if it works.

这篇关于如何通过谷歌地图添加布局?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆