Android float 操作按钮选项菜单

标签 android android-layout speed-dial

enter image description here

有很多用于实现 FAB 菜单的自定义库。但我希望在不使用任何自定义库的情况下完成它。我想在本地实现这个 FAB 菜单。

请不要向我推荐任何自定义库

最佳答案

你可以去android的设计库。将此 gradle 添加到您的构建文件中

compile 'com.android.support:design:23.0.1'

并关注this链接,这是一个 stackoverflow 链接,告诉您如何使用。和 this is示例应用程序的链接。

示例:

<android.support.design.widget.FloatingActionButton
    android:id="@+id/fab"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_margin="16dp"
    android:clickable="true"
    android:src="@drawable/ic_done"
    app:layout_anchor="@id/viewA"
    app:layout_anchorGravity="bottom|right|end"/>

您可以创建多个 fab 并使用它的可见性

更新

我认为您必须使用第三方库来执行此操作。请通过this图书馆,这可能对你有帮助

关于Android float 操作按钮选项菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32943890/

相关文章:

java - 无法将文本设置到 TextView

android - 按下硬件后退按钮时如何返回到上一个 fragment

Android Volley - 发布请求 - 无法在线工作

Android - Relative_to_Parent 对比。相对于自己

Android 设计支持库可扩展 float 操作按钮 (FAB) 菜单

android - 如何在android中拆分相机预览?

Android - 将 View 动态添加到 View 中

android - float 操作按钮图标不在中心

android - flutter 错误 : no named parameter with the name "overflow"