【问题标题】:FloatingActionButton remove press animationFloatingActionButton 移除按下动画
【发布时间】:2020-08-28 20:25:54
【问题描述】:

我正在开发一个只拍照的相机应用。我决定使用锚定到底部应用栏的 FloatingActionButton 来进行相机捕捉操作。一切都很好,但是我对 FloatingActionButton 本身有点困难。当我按住按钮时,会出现一个带有六边形的阴影。我根本不想要这个动画。我该如何删除这个?

这里是确切问题的图像:The Issue

代码如下:

 <com.google.android.material.floatingactionbutton.FloatingActionButton
        android:id="@+id/capture_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:backgroundTint="@android:color/transparent"
        android:clickable="true"
        android:contentDescription="@string/shutter"
        android:focusable="true"
        android:soundEffectsEnabled="true"
        android:tint="@color/white"
        app:backgroundTint="@color/white"
        app:borderWidth="3dp"
        app:elevation="0dp"
        app:fabCustomSize="90dp"
        app:rippleColor="@null"
        android:scaleType="fitXY"
        app:layout_anchor="@id/bottom_app_bar" />

【问题讨论】:

    标签: android xml android-layout floating-action-button google-material-icons


    【解决方案1】:

    您可以尝试设置backgroundstateListAnimator="@null"

    【讨论】:

    • 以下似乎都不起作用:android:stateListAnimator="@null" android:background="@null" app:stateListAnimator="@null" app:background="@null"跨度>
    • 您是否尝试为背景分配值?例如android:background="@android:color/white"?
    • 是的,我做到了,但它似乎也不起作用。我也试过@android:color/transparent
    猜你喜欢
    • 2016-04-05
    • 1970-01-01
    • 1970-01-01
    • 2012-06-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多