简体   繁体   English

如何在相对布局中有效滚动时隐藏工具栏?

[英]How to hide toolbar while scrolling efficientliy in relativeLayout?

I'm trying to hide the toolbar by making it invisible while scrolling and visible on stop,but it's not smooth .我试图通过在滚动时使其invisible并在停止时visible来隐藏工具栏,但它并不平滑。

Can anyone please suggest any better option for hiding toolbar elegantly while scrolling in relativeLayout任何人都可以提出更好的选择,以便在relativeLayout布局中滚动时优雅地隐藏工具栏

Not sure this is what you want, but this can make the system UI smooth show/hide when scrolling.不确定这是您想要的,但这可以使系统 UI 在滚动时平滑显示/隐藏。 SeeUsing Immersive Full-Screen Mode请参阅使用沉浸式全屏模式

You should use the Coordinator Layout as a parent in the xml file.您应该使用 Coordinator Layout 作为 xml 文件中的父级。 Coordinator Layout is designed to support this type of actions and "synchronise" this actions.协调器布局旨在支持此类操作并“同步”这些操作。

The is a good tutorial here: https://mzgreen.github.io/2015/06/23/How-to-hideshow-Toolbar-when-list-is-scrolling(part3)/这是一个很好的教程: https : //mzgreen.github.io/2015/06/23/How-to-hideshow-Toolbar-when-list-is-scrolling(part3)/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 滚动时隐藏工具栏 - hide Toolbar while scrolling CollapsingToolbarLayout 并在滚动时隐藏工具栏 - CollapsingToolbarLayout and hide toolbar while scrolling 如何在 Web 视图中向下滚动时隐藏操作栏/工具栏 - How to Hide ActionBar/Toolbar While Scrolling Down in Webview 如何在recyclelerView向下滚动时折叠后隐藏工具栏 - How to hide toolbar after collapsing while recyclerView scrolling down 滚动片段工具栏应隐藏在android中 - While Scrolling Fragment toolbar should hide in android 在 Fragment 上滚动时如何隐藏工具栏 - How to hide toolbar when scrolling on Fragment 滚动listview时如何隐藏工具栏? (就像谷歌游戏商店) - How to hide toolbar while scrolling listview up? (Just like google play store) 滚动webview时如何隐藏和显示RelativeLayout标题? - How to hide and show a RelativeLayout header when scrolling a webview? 滚动RecyclerView时无法隐藏工具栏,可能是原因? - Unable to hide Toolbar while scrolling RecyclerView, possible cause? 工具栏不会自动隐藏,在recyclerview中滚动时需要手动按下才能隐藏 - toolbar is not hiding automatically need to push manually to hide while scrolling in recyclerview
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM