是否有任何标准工具或现有的库(例如在Gmail应用程序上)来创建圆形按钮?
最佳答案
在android支持设计支持库中,提供的小部件之一是Floating Action Button,通常添加到右下角(但不必仅在此处使用)
要在您的build.gradle文件中获取android设计支持库,请添加以下代码:
compile 'com.android.support:design:22.2.0'
在您的布局文件中”
<RelativeLayout
...
xmlns:app="http://schemas.android.com/apk/res-auto">
<android.support.design.widget.FloatingActionButton
android:id="@+id/myFAB"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_anchor="@id/appbar"
app:layout_anchorGravity="bottom|right|end"
android:src="@drawable/ic_discuss"
android:layout_margin="10dp"
android:clickable="true"/>
</RelativeLayout>
android设计支持库here的详细信息
也有很多其他库提供FAB的功能,例如
关于android - 如何在Android 5+的右下角创建一个圆形按钮?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/30967633/