gpt4 book ai didi

java - 如何复制收件箱 float 操作按钮(每个子按钮都有文本)?

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:58:10 25 4
gpt4 key购买 nike

我只是想知道是否有人知道如何复制新收件箱应用程序为 Android 提供的 float 操作按钮 View ?我有 float 操作按钮(带有子按钮)与这个库的修改版本一起工作: https://github.com/futuresimple/android-floating-action-button/blob/master/README.md

但是我在尝试获取按钮旁边的 TextView 时遇到了问题,就像在收件箱应用程序中一样。

如果有人可以向我提供有关如何修改库以适应这一点或任何其他实现方式的建议,我将不胜感激。

感谢您的宝贵时间科里

最佳答案

由于 Labels FAB 功能(如 Evernote 或 Inbox 应用程序)被添加到这个很棒的 library随意使用它:

Gradle 依赖:

    compile 'com.getbase:floatingactionbutton:1.3.0'

布局.xml:

     <com.getbase.floatingactionbutton.FloatingActionsMenu
android:id="@+id/multiple_actions"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
fab:fab_addButtonColorNormal="@color/white"
fab:fab_addButtonColorPressed="@color/white_pressed"
fab:fab_addButtonPlusIconColor="@color/half_black"
fab:fab_labelStyle="@style/menu_labels_style"
android:layout_marginBottom="16dp"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp">

<com.getbase.floatingactionbutton.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
fab:fab_colorNormal="@color/white"
fab:fab_title="Action A"
fab:fab_colorPressed="@color/white_pressed"/>

<com.getbase.floatingactionbutton.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
fab:fab_colorNormal="@color/white"
fab:fab_title="Action B"
fab:fab_colorPressed="@color/white_pressed"/>

</com.getbase.floatingactionbutton.FloatingActionsMenu>

menu_labels_style.xml:

    <style name="menu_labels_style">
<item name="android:background">@drawable/fab_label_background</item>
<item name="android:textColor">@color/white</item>
</style>

fab_label_background.xml:

    <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/black_semi_transparent"/>
<padding
android:left="16dp"
android:top="4dp"
android:right="16dp"
android:bottom="4dp"/>
<corners
android:radius="2dp"/>
</shape>

尽情享受吧!

关于java - 如何复制收件箱 float 操作按钮(每个子按钮都有文本)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27009793/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com