相关疑难解决方法(0)

使用官方支持库23.x. + bottomSheet(如google maps)向上滑动图像

更新
我想完成谷歌地图与支持库23.x. +并且没有任何第三个库的相同行为

注意:这不是一个重复的问题,因为:

  1. 我想使用行为,支持库和没有任何第三方库(我在问题标题和上面的描述中添加了它)
  2. 我想要你在下一个gif中看到的所有行为,其他问题是要求一两个行为并使用任何方式来实现它.

    就像你在这个gif中看到的那样

我已经有官方的bottomSheet工作(甚至在选项卡和视图寻呼机内).

令我发疯的是如何在使用官方bottomSheet向上滑动时实现BottomSheet的图像行为?.

我尝试使用像FAB这样的锚没有成功.
我读了一些关于使用滚动监听器的内容,但是ppl说它不像谷歌地图那样平滑和快速.

我的XML(我不认为它会有所帮助,但无论如何):

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
    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"
    tools:context=".ui.MasterActivity">

    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:popupTheme="@style/AppTheme.PopupOverlay"
            app:layout_scrollFlags="scroll|enterAlways|snap">

            <Button
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                style="?android:attr/borderlessButtonStyle"
                android:text="Departure"
                android:layout_gravity="center"
                android:id="@+id/buttonToolBar"
                />


        </android.support.v7.widget.Toolbar>

        <android.support.design.widget.TabLayout
            android:id="@+id/tabs"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:tabBackground="@android:color/white"
            app:tabTextColor="@color/colorAccent"
            app:tabSelectedTextColor="@color/colorAccent"/>

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

    <android.support.v4.view.ViewPager
        android:id="@+id/viewpager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior" />


    <android.support.v4.widget.NestedScrollView
        android:id="@+id/asdf"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        app:behavior_peekHeight="100dp"
        android:fitsSystemWindows="true"
            app:layout_behavior="android.support.design.widget.BottomSheetBehavior">

        <LinearLayout
            android:id="@+id/qwert"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"
            android:paddingBottom="16dp"
            android:background="@android:color/white"
            android:padding="15dp">

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content" …
Run Code Online (Sandbox Code Playgroud)

android google-maps parallax bottom-sheet

41
推荐指数
1
解决办法
8497
查看次数

标签 统计

android ×1

bottom-sheet ×1

google-maps ×1

parallax ×1