安卓 : Difference FloatingActionButton and normal button

标签 android floating-action-button

我试过演示 FloatingActionButton .我没有看到为什么我应该从普通按钮类更改为 FloatingActionButton 的真正区别,因为如果我想制作圆形按钮,我可以试试这个教程:make circular button

作为 Android 文档的定义:

Floating action buttons are used for a special type of promoted action. They are distinguished by a circled icon floating above the UI and have special motion behaviors related to morphing, launching, and the transferring anchor point.

Floating action buttons come in two sizes: the default and the mini. The size can be controlled with the fabSize attribute.

我认为这里的所有内容我都可以在普通按钮中轻松实现,例如大小、圆圈、UI 上方。只有一件事我不明白:

special motion behaviors related to morphing, launching, and the transferring anchor point

这个我还真不知道。 morphing lauching and transferring anchor point 是什么意思。请为我解释一下。

谢谢:)

最佳答案

Google 的 Material Design Guidelines 中有一篇关于 float 操作按钮的好文章:https://www.google.com/design/spec/components/buttons-floating-action-button.html有很多示例说明如何(以及应该和不应该)在 Activity 转换时使用 float 操作按钮,以及如何使用它来创建漂亮、有意义和合乎逻辑的动画。

如果您将正确的 Floating Action Button(来自 Support Design 库的那个)与 CoordinatorLayout 一起使用,它也会处理 Snackbars。当 Snackbar 出现时,Floating Action Button 会向上移动,以免被 Snackbar 覆盖。您可以在这里查看:http://android-developers.blogspot.cz/2015/05/android-design-support-library.html

关于安卓 : Difference FloatingActionButton and normal button,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32542963/

相关文章:

android - 逆向工程 Android Assets

Android使用改造后的方法将照片发送到服务器

android - 如何根据Android中与当前位置的距离对地理点进行排序

android - 如何在不使用 nestedScrollView 的情况下在 webview 滚动时隐藏和显示 FAB

android - 如何获取屏幕高度并调整 View 以适应比例

android - 如何加快calabash-android的查询速度

android - setLayoutParams FloatingButton 上的 NullPointerException

android - 其他应用程序和启动器中的 float 操作按钮

ios - 将 float 操作按钮添加到选项卡栏 Controller 内的 View Controller

java - EditText 上的 FloatingActionButton 不可点击