Using Material theme on L preview

只愿长相守 提交于 2019-11-29 01:26:49

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!