gpt4 book ai didi

java - 可以使用 FloatingActionButton 而不会出现延迟吗?

转载 作者:行者123 更新时间:2023-12-01 17:25:34 25 4
gpt4 key购买 nike

我正在使用FloatingActionButton并且它可以正常工作。不过,我想改变它的行为。我希望它的行为像 ImageButton。当我向下滚动布局时,我希望它与其他 View 一起移动并消失在屏幕外。我不希望它始终保持在最前面。

我知道有一个替代解决方案,我需要将 FloatingActionButton 的样式复制到 ImageView 中。不过,我想知道是否可以仅使用 FloatingActionButton 来完成我想要的操作。

谢谢。

最佳答案

取自Material IO文档中, float 操作按钮具有以下用法:

A floating action button (FAB) performs the primary, or most common, action on a screen. It appears in front of all screen content, typically as a circular shape with an icon in its center. FABs come in three types: regular, mini, and extended.

但正如您所要求的,您希望将其用作与屏幕上的其他 View 一起滚动的简单 View 。以这种方式思考,您可以设置与上下文无关的 FAB 最明显的特征,即高度。

在您的layout.xml 文件中:

<FloatingActionButton
app:elevation="0dp"/>

关于java - 可以使用 FloatingActionButton 而不会出现延迟吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61216802/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com