材料设计中有哪些不同类型的圆形按钮?(浮动动作按钮除外)

时间:2015-09-16 15:28:59

标签: android android-5.0-lollipop

默认的棒棒糖应用程序(如motoG中的拨号器)在LISTVIEWS和TOOLBAR中都有一些圆形的标志性按钮,请参考屏幕截图 The red circles 1,2,3 are rounded buttons I am talking about 请告诉我这些按钮是什么,根据我的理解2,3是TOOLBAR(动作栏)图标,我假设1按钮是浮动动作按钮。

请分享一个示例代码,以创建一个像图像中的按钮,尤其是第一个按钮。

2 个答案:

答案 0 :(得分:2)

那个按钮很简单。使用AppCompat库可以使用?attr/selectableItemBackgroundBorderless作为背景,从而达到预期的效果。

<ImageButton
    android:src="@drawable/some_drawable"
    android:layout_width="wrap_content"
    android:background="?attr/selectableItemBackgroundBorderless"
    android:layout_height="wrap_content" />

答案 1 :(得分:-3)

这是一个制作按钮。

在项目中包含Angular Material,然后使用以下代码创建评论&#39;制造按钮。

<md-button class="md-fab" aria-label="Comment">
    <md-icon md-svg-src="img/icons/ic_comment_24px.svg"></md-icon>
</md-button>