Android的工具栏+ Tab键布局+抽屉,隐藏的工具栏滚动时,采取TabLayout顶端 [英] Android Toolbar + Tab Layout + Drawer, Hide toolbar when scrolling and take TabLayout to the top

查看:408
本文介绍了Android的工具栏+ Tab键布局+抽屉,隐藏的工具栏滚动时,采取TabLayout顶端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个连接到它的抽屉的活动。抽屉每个菜单是一个片段,菜单中的一个下我与 TabLayout 片段,每个选项卡包含一个 RecyclerView
所以,现在,当我滚动 RecyclerView ,标签布局是越来越隐蔽,但工具栏仍然在顶部。我需要的是工具栏来获得隐藏( scrollFlags:滚动| enterAlways )和 TabLayout 应显示在顶部得到。

I have activity which has drawer attached to it. Each menu of the drawer is a fragment, and under one of the menu I have a fragment with TabLayout, and each tab contains a RecyclerView. So now, when I scroll the RecyclerView, tab layout is getting hidden but ToolBar remains at the top. What I need is to ToolBar to get hidden(scrollFlags:scroll|enterAlways), and TabLayout should get shown at the top.

所以目前的设置是:

活动附带DrawerLayout
     - >片段与TabLayout
           - >标签片段1 RecyclerView
           - >标签片段2 RecyclerView

推荐答案

减code更有效

您好@Vishal我发现你太多。因为我也是前一段时间寻找这个话题。

Hello @Vishal i have found too much for you. because i am also searching this topic before some time.

我发现一个名为辉煌的图书馆 MaterialViewPager 这是完全定制你想要什么滚动模式隐藏。

I have found one brilliant library named MaterialViewPager this is fully customize with what you want to hide in scroll mode.

查看 https://www.youtube.com/watch?v=r95Tt6AS18c <视频/ A>

See the video on https://www.youtube.com/watch?v=r95Tt6AS18c

在这里输入的形象描述

这篇关于Android的工具栏+ Tab键布局+抽屉,隐藏的工具栏滚动时,采取TabLayout顶端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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