是否有在Android的材料设计的浮动操作按钮本地组件? [英] Is there a native component for the Floating action button in Android Material Design?

本文介绍了是否有在Android的材料设计的浮动操作按钮本地组件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题围绕<一个旋转href="https://www.google.com/design/spec/components/buttons-floating-action-button.html#buttons-floating-action-button-floating-action-button"相对=nofollow> 浮动操作按钮 这是在Android的材料设计介绍。

My question revolves around the Floating action button that was introduced in Android Material Design.

有许多图书馆在GitHub上提供了该组件为:

There are many library offering this component on GitHub as:

  1. Android的浮点操作按钮
  2. FloatingActionButton
  3. CircularFloatingActionMenu
  4. 晶圆厂
  5. 浮动动作按钮
  1. Android-floating-action-button
  2. FloatingActionButton
  3. CircularFloatingActionMenu
  4. Fab
  5. Floating-action-button

不过,我的问题是:

是否与 android.support.vX 的最后一个发行版是专为浮动操作按钮?

Is there a native component with the last release of android.support.vX that was built for Floating action button?

如组件:

  • android.support.v7.cardview
  • android.support.v4.widget.DrawerLayout
  • android.support.v7.widget.RecyclerView
  • ...

推荐答案

今天(29/05/2015),它是正式缴费与新材料设计支持库。

Today (29/05/2015) it is officially avaiable with the new Material Design support Library.

就在这个依赖添加到您的 build.gradle

Just add this dependency to your build.gradle

compile 'com.android.support:design:22.2.0'

添加此视图布局:

<android.support.design.widget.FloatingActionButton
    android:id="@+id/fab"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="end|bottom"
    android:src="@drawable/ic_done" />

和使用它:

FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
        //TODO
    }
});

更多信息<一个href="http://developer.android.com/reference/android/support/design/widget/FloatingActionButton.html"相对=nofollow>这里。

这篇关于是否有在Android的材料设计的浮动操作按钮本地组件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆