android – Airbnb探索屏幕等工具栏中的自定义视图

android – Airbnb探索屏幕等工具栏中的自定义视图,第1张

概述我想在应用程序(工具栏)的顶部栏区域添加多个输入字段,以便我的应用程序进行搜索.我看到Airbnb做到了最好!我在CoordinatorLayout中尝试了使用AppBarLayout的各种场景,但都失败了.是否有可能获得相同或类似的效果?如果是的话,我们该怎么做? 这是我向上滑动顶部栏时的屏幕截图: Yes it is possible to create using appbar layout 我想在应用程序(工具栏)的顶部栏区域添加多个输入字段,以便我的应用程序进行搜索.我看到Airbnb做到了最好!我在CoordinatorLayout中尝试了使用AppbarLayout的各种场景,但都失败了.是否有可能获得相同或类似的效果?如果是的话,我们该怎么做?

这是我向上滑动顶部栏时的屏幕截图:



解决方法

Yes it is possible to create using appbar layout,I have trIEd same task,Finally i have figured-out in this way,I guess below code is helpful for you

<?xml version="1.0" enCoding="utf-8"?>   <layout xmlns:androID="http://schemas.androID.com/apk/res/androID"    xmlns:app="http://schemas.androID.com/apk/res-auto">    <linearLayout        androID:layout_wIDth="match_parent"        androID:layout_height="match_parent"        androID:orIEntation="vertical">        <!--your toolbar-->        <include            androID:ID="@+ID/toolbar_wrapper"            layout="@layout/common_toolbar"            androID:layout_wIDth="match_parent"            androID:layout_height="wrap_content" />        <androID.support.design.Widget.CoordinatorLayout            androID:layout_wIDth="match_parent"            androID:layout_height="match_parent">            <androID.support.design.Widget.AppbarLayout                androID:ID="@+ID/appbar"                androID:layout_wIDth="match_parent"                androID:layout_height="wrap_content"                androID:background="@color/color_fafafa"                androID:orIEntation="vertical">                <linearLayout                    androID:layout_wIDth="match_parent"                    androID:layout_height="match_parent"                    androID:background="@color/color_ffffff"                    androID:orIEntation="vertical"                    app:layout_scrollFlags="scroll">                    <!--your scrolling layout,in your case it will be edit texts and search fIElds-->                </linearLayout>            </androID.support.design.Widget.AppbarLayout>            <linearLayout                androID:layout_wIDth="match_parent"                androID:layout_height="match_parent"                androID:orIEntation="vertical"                app:layout_behavior="@string/appbar_scrolling_vIEw_behavior">                <androID.support.design.Widget.TabLayout                    androID:ID="@+ID/tab_layout"                    androID:layout_wIDth="match_parent"                    androID:layout_height="@dimen/dp_49"                    androID:background="@color/color_ffffff"                    androID:theme="@style/themeOverlay.AppCompat.Dark.Actionbar"                    app:tabIndicatorcolor="@color/colorAccent"                    app:tabSelectedTextcolor="@color/color_727272"                    app:tabTextcolor="@color/color_b6b6b6" />                <VIEw                    androID:layout_wIDth="match_parent"                    androID:layout_height="@dimen/dp_1"                    androID:background="@color/color_d9d9d9" />                <!--your main layout-->                <androID.support.v4.vIEw.VIEwPager                    androID:ID="@+ID/detail_pager"                    androID:layout_wIDth="match_parent"                    androID:layout_height="match_parent"                    androID:nestedScrollingEnabled="true" />            </linearLayout>        </androID.support.design.Widget.CoordinatorLayout>    </linearLayout></layout>
总结

以上是内存溢出为你收集整理的android – Airbnb探索屏幕等工具栏中的自定义视图全部内容,希望文章能够帮你解决android – Airbnb探索屏幕等工具栏中的自定义视图所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/web/1139196.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-31
下一篇 2022-05-31

发表评论

登录后才能评论

评论列表(0条)

保存