【问题标题】:Extended Android Floating Button扩展的 Android 浮动按钮
【发布时间】:2016-02-19 04:23:45
【问题描述】:

我开发了 Android 应用程序,我想在我的布局中使用扩展的浮动按钮,例如路径应用程序上的浮动按钮。我希望有人能给我举例说明如何制作这些东西的代码。谢谢。

【问题讨论】:

    标签: android android-layout floating-action-button


    【解决方案1】:
      <com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Hellooooo"
                app:icon = "@drawable/pass_resource_here"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintRight_toRightOf="parent"
            </com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton>
    

    【讨论】:

    • 在新增的ExtendedFloatingActionButton中可以同时添加图标和文字。
    • 你知道如何在FAB扩展/收缩时增加持续时间吗?
    【解决方案2】:

    这里有一个详细的教程,教你如何用动画创建一个好的扩展浮动按钮https://www.learn2crack.com/2015/10/android-floating-action-button-animations.html

    【讨论】:

    • 它运行良好。非常感谢您帮助我解决了我的问题。
    【解决方案3】:

    尝试使用此库,并使用库中的示例项目将其修改为您喜欢的方式

    https://github.com/oguzbilgener/CircularFloatingActionMenu

    【讨论】:

      猜你喜欢
      • 2015-06-23
      • 2019-11-27
      • 1970-01-01
      • 1970-01-01
      • 2015-09-15
      • 2015-08-30
      • 2020-01-11
      • 2021-10-11
      相关资源
      最近更新 更多