Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/215.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 波纹效果框架布局圆形按钮_Android_Button_Effect_Ripple - Fatal编程技术网

Android 波纹效果框架布局圆形按钮

Android 波纹效果框架布局圆形按钮,android,button,effect,ripple,Android,Button,Effect,Ripple,我的布局中有这种显示: <FrameLayout android:layout_width="110dp" android:layout_height="110dp" android:layout_marginBottom="5dp" android:layout_marginTop="10dp" android:background="@drawable/roundbu

我的布局中有这种显示:

<FrameLayout
            android:layout_width="110dp"
            android:layout_height="110dp"
            android:layout_marginBottom="5dp"
            android:layout_marginTop="10dp"
            android:background="@drawable/roundbutton"
            android:backgroundTint="@color/beatiful_yellow"
            android:foreground="?attr/selectableItemBackground"
            android:clickable="true">

            <Button
                android:id="@+id/downloadButton"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_gravity="center"
                android:background="@null"
                android:drawableLeft="@drawable/ic_file_download_black_60px"
                android:gravity="center"
                android:minHeight="0dp"
                android:minWidth="0dp"
                android:drawableTint="@color/colorAccent"
                android:foreground="?attr/selectableItemBackground"
                />
        </FrameLayout>

使用roundbutton.xml,如:

<?xml version="1.0" encoding="utf-8"?>
    <shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <solid android:color="#eeffffff" />
    <corners android:radius="110dp"/>
</shape>

它允许我有一个圆形按钮,中间有一个图标。 但是现在,我想在点击按钮时产生连锁反应

我尝试了很多解决方案,比如这一个,但没有一个奏效。当点击按钮时,有没有技巧可以产生可接受的效果?Ripple会很好,但我想另一个也可以做到

谢谢:)

===========================================

编辑:

感谢Rockney的评论,它现在正在使用以下代码:

            <android.support.design.widget.FloatingActionButton
            android:layout_width="110dp"
            android:layout_height="110dp"
            android:backgroundTint="@color/beatiful_yellow"
            android:src="@drawable/ic_file_download_black_60px"
            android:tint="@color/colorAccent"
            android:clickable="true"
            android:background="?selectableItemBackgroundBorderless"
            />


您可能需要查看floatingAction按钮。它是一个带中心图标的圆形按钮。你可以定制。太棒了!这正是我需要的。谢谢:)