使用材料的主题对L- preVIEW [英] Using Material theme on L preview

查看:217
本文介绍了使用材料的主题对L- preVIEW的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

第l开发preVIEW是目前在API层面20.然而,显然是主题需要API级别21

The L Developer Preview is currently on API level 20. However, apparently the themes require API level 21.

@android:款式/ Theme.Material.Light.DarkActionBar 需要API级别21

@android:style/Theme.Material.Light.DarkActionBar requires API level 21

这是一个错误,我是不是做错了什么,或者是它只是无法使用材料在L preVIEW?

Is this a mistake, am I doing something wrong, or is it just not possible to use Material on the L Preview?

推荐答案

要详细说明@帕尼尼的意见,我在我的 build.gradle 使用本P>

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
    }

/* ... */
}

配售 styles.xml 值-V21 文件夹,使主题在L $运行p $ PVIEW。

Placing the styles.xml in the values-v21 folder, enables the theme to run on the L Preview.

这篇关于使用材料的主题对L- preVIEW的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆