Material Design向后兼容性

syn*_*gma 63 android backwards-compatibility material-design android-5.0-lollipop material-theme

从Android Developer页面上提供的示例中,我看到新的视图,如RecyclerView,向后兼容(android.support.v7.widget.RecyclerView).

Material Design中引入的所有新东西是否向后兼容(哪个版本)?

Par*_*ani 49

更新此答案,因为Lollipop OS正式发布了支持库,您可以在项目中使用这些库来提供与旧版本的兼容性.

支持库: v7 appcompat库

此库添加了对Action Bar用户界面设计模式的支持.该库包括对材料设计用户界面实现的支持.

如果您使用的是Android Studio,则只需要包含以下依赖项标识符:

com.android.support:appcompat-v7:21.0.+
Run Code Online (Sandbox Code Playgroud)

  • 自从Lollipop发布以来,这个答案已被弃用. (8认同)
  • ^我不知道@GlennBech是否是拖钓或严重;)这根本不好玩.:p (5认同)

Ino*_*noy 30

从Android 2.2(API 8)到现在5.0(API 21)的材料设计

这是你需要的:

  1. 工具栏
  2. 小部件的材质设计库(按钮,复选框等)

1.工具栏

得到这个想法,你准备好了.

<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"/>
Run Code Online (Sandbox Code Playgroud)

设置指南:http://antonioleiva.com/material-design-everywhere/

来源举例:https://github.com/antoniolg/MaterialEverywhere

要使工具栏工作较低,API 11使用Theme.AppCompat.Light.NoActionBar(而不是windowActionBar设置为false)

<style name="NoActionBarTheme" parent="Theme.AppCompat.Light.NoActionBar">
     ...
</style>
Run Code Online (Sandbox Code Playgroud)

2.材料设计库

这里是漂亮按钮等的Material Design Library.

指南,代码,示例 - https://github.com/navasmdc/MaterialDesignLibrary

指导如何将库添加到Android Studio 1.0 - 如何将材质设计库导入Android Studio?

.

快乐的编码;)


Chu*_*ulo 10

Officialy Material Design是倒退到v7 appcompat支持库.