我试过演示 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/