简体   繁体   English

当CollapsingToolbarLayout折叠时,工具栏HOME不起作用

[英]Toolbar HOME not working when CollapsingToolbarLayout collapsed

Posting this now, will update with more specific XML when I get home, but I have a layout setup: 现在发布,当我回到家时会更新更具体的XML,但我有一个布局设置:

Coordinator - Appbar -- Collapsing --- ImageView --- Toolbar -- Frame/Recycler (fragment loaded) 协调员 - Appbar - 折叠--- ImageView ---工具栏 - 框架/循环器(片段加载)

And everything is cool, the Home/Back button works in the toolbar when the CollapsingToolbarLayout is expanded. 并且一切都很酷,当扩展CollapsingToolbarLayout时,Home / Back按钮在工具栏中工作。 But as soon as the title of the collapsing toolbar moves into the spot beside the Home button, the button is no longer clickable. 但是,只要折叠工具栏的标题移动到“主页”按钮旁边的位置,该按钮就不再可单击。

The back button is responding to touches all the way up until its nearly almost collapsed. 后退按钮一直对触摸进行响应,直到其几乎崩溃为止。

It's as if the Title in the collapsing toolbar is catching the touch events and consuming them. 就好像折叠工具栏中的标题正在捕捉触摸事件并消耗它们一样。 But I couldn't find anything from looking around that might explain that. 但我找不到任何可以解释的东西。

I'll post more complete Xml after work. 我下班后会发布更完整的Xml。 But hopefully someone has had something similar just from the description. 但是希望有人从描述中得到了类似的东西。

Resolved ish. 解决了ish。 I was using a base activity and common XML file and for some reason it was not liking that. 我正在使用基本活动和常见的XML文件,并且由于某种原因它不喜欢它。 I created a new XML by copying the common and adding the nested scroll view to the activity instead of fragment. 我通过复制common并将嵌套的scroll视图添加到activity而不是fragment来创建了一个新的XML。 Now the fragment is just a linear layout. 现在片段只是一个线性布局。

暂无
暂无

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

相关问题 CollapsingToolbarLayout折叠时未显示工具栏标题 - Toolbar Title not showing when CollapsingToolbarLayout collapsed 当CollapsingToolbarLayout折叠时,锚定图像会被工具栏重叠 - Anchor image gets overlapped by toolbar when CollapsingToolbarLayout is collapsed 未折叠时,工具栏的某些部分在CollapsingToolbarLayout的ImageView上可见 - When not collapsed some part of the the toolbar is visible over the ImageView of CollapsingToolbarLayout 如何将RecyclerView放在CollapsingToolbarLayout下面并在Android中折叠时响应工具栏? - How to put RecyclerView below CollapsingToolbarLayout and responsive to toolbar when collapsed in Android? 即使 CollapsingToolbarLayout 折叠,如何使 Toolbar 和 TabLayout 仍然可见? - How to make Toolbar and TabLayout still visible even when CollapsingToolbarLayout is collapsed? 在 CollapsingToolbarLayout 中折叠时如何删除透明的工具栏填充 - How to remove transparent Toolbar padding when collapsed in CollapsingToolbarLayout 如何将CollapsingToolbarLayout的背景保留为ToolBar的背景,即使在折叠时也是如此 - How to keep the background of CollapsingToolbarLayout as the background of ToolBar even when collapsed 滚动时,CollapsingToolbarLayout未折叠 - CollapsingToolbarLayout not collapsed when scrolled 在CollapsingToolbarLayout中,工具栏在折叠状态下不可见 - Toolbar not visible in collapsed state inside CollapsingToolbarLayout collapsingToolbarLayout仅在折叠时设置标题 - collapsingToolbarLayout set title only when collapsed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM