从Android开发者页面提供的示例中,我看到像RecyclerView
这样的新视图是向后兼容的(android.support.v7.widget.RecyclerView
)。
在Material Design中引入的所有新内容都向后兼容吗?适用于哪个版本?
从Android开发者页面提供的示例中,我看到像RecyclerView
这样的新视图是向后兼容的(android.support.v7.widget.RecyclerView
)。
在Material Design中引入的所有新内容都向后兼容吗?适用于哪个版本?
随着支持库的发布,您可以在项目中使用它们来向旧版本提供兼容性。这里更新此答案以适应正式发布的Lollipop操作系统。
支持库: v7 appcompat库
此库添加了对操作栏用户界面设计模式的支持。该库包括对材料设计用户界面实现的支持。
如果您正在使用Android Studio,则只需要包含以下依赖项标识符:
com.android.support:appcompat-v7:21.0.+
if (Build.VERSION.SDK_INT >= 21) {
。 - Jacob Tabak以下是您需要的:
只需理解概念,您就可以开始了。
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimaryDark"/>
安装指南:http://antonioleiva.com/material-design-everywhere/
包含示例的源代码:https://github.com/antoniolg/MaterialEverywhere
要在低于API 11的设备上使用 Toolbar,请使用 Theme.AppCompat.Light.NoActionBar 主题(而不是将 windowActionBar 设置为 false)。
<style name="NoActionBarTheme" parent="Theme.AppCompat.Light.NoActionBar">
...
</style>
这里有一个漂亮的按钮等等的 Material Design Library。
指南、代码、示例 - https://github.com/navasmdc/MaterialDesignLibrary
如何将库添加到 Android Studio 1.0的指南 - 如何将材料设计库导入到Android Studio中?
.
愉快的编码 ;)
补充Paresh的回答,不是所有Material Design的功能都适用于较旧的版本。自定义主题和活动转换仅适用于API > 21,但正如其他人提到的,一些功能在支持库中可用。
https://developer.android.com/training/material/compatibility.html
com.android.support:design:22.2.0
Google 设计支持库于 2015 年 I/O 大会推出
http://android-developers.blogspot.gr/2015/05/android-design-support-library.html
在那里,您将找到许多关于材料设计的好东西。
还有更多...