问题
The L Developer Preview is currently on API level 20. However, apparently the themes require API level 21.
@android:style/Theme.Material.Light.DarkActionBar
requires API level 21
Is this a mistake, am I doing something wrong, or is it just not possible to use Material on the L Preview?
回答1:
To elaborate on @panini's comments, I'm using this in my build.gradle
:
android {
compileSdkVersion 'android-L'
buildToolsVersion '20.0.0'
defaultConfig {
minSdkVersion 16
targetSdkVersion 'L'
versionName buildVersion.version
}
/* ... */
}
Placing the styles.xml
in the values-v21
folder, enables the theme to run on the L Preview.
来源:https://stackoverflow.com/questions/24439958/using-material-theme-on-l-preview