小编sad*_*rvi的帖子

如何像谷歌地图一样创建底页?

我在我的项目中使用谷歌地图,我想像谷歌地图一样显示底部表格的位置信息使用。

我需要像 Google Maps Button 表那样分三个阶段显示。

阶段1:

在此处输入图片说明

第 2 阶段:

在此处输入图片说明

第 3 阶段:

在此处输入图片说明

为此,我使用了以下组件:ThisThis

但我没有成功:(

这是我的代码:

片段布局:

<android.support.design.widget.CoordinatorLayout
    android:id="@+id/bottomSheet_main_content"
    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:background="@android:color/white">

<android.support.design.widget.CoordinatorLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <android.support.design.widget.AppBarLayout
        android:id="@+id/smooth_app_bar_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        android:fitsSystemWindows="true">

        <android.support.design.widget.CollapsingToolbarLayout
            android:id="@+id/collapsing_toolbar"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_scrollFlags="scroll|exitUntilCollapsed"
            android:fitsSystemWindows="true"
            app:contentScrim="?attr/colorPrimary"
            app:expandedTitleMarginStart="48dp"
            app:expandedTitleMarginEnd="64dp">
               <ViewFlipper
                   android:layout_below="@+id/bottomSheet_toolbar"
                   android:layout_width="match_parent"
                   android:layout_height="300dp"
                   android:id="@+id/bottom_sheet_viewflipper"
                   android:scaleType="centerCrop"
                   android:fitsSystemWindows="true"
                   app:layout_collapseMode="parallax"/>
                <android.support.v7.widget.Toolbar
                    android:id="@+id/bottomSheet_toolbar"
                    android:layout_width="match_parent"
                    android:layout_height="?attr/actionBarSize"
                    android:background="@drawable/gradiant_background"
                    app:popupTheme="@style/AppTheme.PopupOverlay"
                    app:layout_collapseMode="pin">
                    <ImageView
                        android:layout_width="24dp"
                        android:layout_height="24dp"
                        app:srcCompat="@drawable/vector_drawable_arrow_left_"/>
                    </android.support.v7.widget.Toolbar>

        </android.support.design.widget.CollapsingToolbarLayout>

    </android.support.design.widget.AppBarLayout>

        <ImageView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fitsSystemWindows="true"
            android:scaleType="fitXY"
            android:id="@+id/bottomSheet_background_image"
            android:layout_below="@+id/smooth_app_bar_layout"/>
        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_below="@+id/smooth_app_bar_layout" …
Run Code Online (Sandbox Code Playgroud)

android google-maps bottom-sheet

5
推荐指数
0
解决办法
4626
查看次数

标签 统计

android ×1

bottom-sheet ×1

google-maps ×1