Android的浮动操作按钮的API 19(奇巧) [英] Android Floating Action Button API 19 (KitKat)
问题描述
我需要实现一个浮动的操作按钮,根据谷歌设计准则,我Android的应用程序的API级别19。
I need to implement a floating action button, according to Google Design Guidelines, on my android application with API level 19.
不过,我想知道,如果一些原生支持库(如V4,V7,V13),以帮助我,而不需要外部的依赖关系建立这个组件。
However, I would know if some native support library (like v4, v7, v13) to help me build this component without the need for external dependencies.
推荐答案
近日谷歌已经发布了基于的材料设计方针。在Android开发者博客详细介绍了这个职位。
Recently Google has released a new support library based on Material Design Guideline. The Android Developers Blog details the same components in this post.
该库可已经使用摇篮添加在build.gradle以下行:
The library can be already used with Gradle adding the following line in build.gradle:
dependencies {
...
compile 'com.android.support:design:22.2.1'
}
这是使用一个简单的例子:
This is a simple example of usage:
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_add"
android:layout_gravity="bottom|end" />
请参阅与支持库的 FloatingActionButton例子。
See more FloatingActionButton example with Support Library.
这篇关于Android的浮动操作按钮的API 19(奇巧)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!