android - 将扩展 FAB 转换为标准 FAB

标签 android material-design floating-action-button

是否有人已经实现了将扩展 FAB 转换为标准 FAB,反之亦然?我知道如何将 FAB 添加到我的布局中以及如何检测列表滚动阈值,但我真的不知道如何实现这种转换(请参阅引用资料以了解我想做什么:Extented FAB into standard FAB)。

非常感谢

亲切的问候

最佳答案

只需为此行为添加 2 行神奇代码此代码仅适用于 ExtendedFloatingActionButton

floatingButton.shrink(); ///This line of code hide text and show Icon of floating buttion

floatingButton.extend()///This line of code show text and icon of floating button

关于android - 将扩展 FAB 转换为标准 FAB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50482726/

相关文章:

android - float 操作按钮 : Setting a custom background is not supported

android - 如何在 NotificationCompat.Builder.setLargeIcon() 中加载 Glide 缓存图片?

android - 海拔不适用于 android.support.design.widget.FloatingActionButton

java - 无法使用 Eclipse 上的最新更新修改属性

android - 将 Toolbar 设置为 ActionBar 时出错

android - 什么是android中的静止海拔?

android - 如何在 FloatingActionButton 上显示图标?

android - 如何用 onTouchListener 改变 fab 的位置?

java - Activity 中的重叠 fragment

java - 是否有可能获得从标准谷歌地图导航到我们的应用程序到达目的地的估计时间?