折叠工具栏锚定视图在折叠时隐藏

Collapsing toolbar anchored view is hidding when collapse

我需要显示锚定到工具栏的 TextView(带有“0”的圆形),就像 FAB,但它必须始终可见。

我的问题是,当我折叠工具栏(滚动 recyclerView)时,在完全折叠状态下,它隐藏了视图的一半... TextView 布局具有以下属性:

app:layout_anchor="@id/appbar"
app:layout_anchorGravity="bottom|center_horizontal"

有人知道怎么解决吗?

如果您希望您的TextView 位于工具栏上方,在这种情况下,您可以尝试为TextView 设置更高的高度值。在某些情况下,它对我有用。

例如:

android:elevation="15dp"