【发布时间】:2015-07-28 07:52:48
【问题描述】:
我使用 android studio,我想使用 API 中低于 21 的材料设计功能。 首先,我阅读了这些问题:
how to use material design features in api lower than 21 in eclipse?
I want Material Design in Pre 5.0 device in eclipse
Android Design Support Library And Material Design Backwards Compatibility?
我还阅读了这些:
https://developer.android.com/training/material/compatibility.html
https://developer.android.com/tools/support-library/features.html#v7-appcompat
我还使用本教程创建了一个兼容的材料设计项目:
http://www.androidhive.info/2015/04/android-getting-started-with-material-design/
我添加了这个库:com.android.support:appcompat-v7:21.0.0 并且我使用了上一个链接一样的材料主题,但我在我的 android 4.2.2 中看不到任何材料功能。正如我从谷歌开发人员那里发现的那样,它使用兼容性来显示 API 21 中的材料特征,并且它仍然可以在低于 21 的 android 中没有材料特征的情况下工作。 那么对于低于 21 的 android 怎么使用材质特性呢?
我的毕业典礼是这样的:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "test.parsoa.com.newmaterial"
minSdkVersion 17
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile "com.android.support:appcompat-v7:21.0.0"
}
【问题讨论】:
-
你的
build.gradle是什么样的?
标签: android compatibility material-design