Theme.AppCompat.Light.NoActionBar在Android工作室找不到 [英] Theme.AppCompat.Light.NoActionBar not found on Android Studio

查看:5683
本文介绍了Theme.AppCompat.Light.NoActionBar在Android工作室找不到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对不起,也许这不是新话题,但真正需要帮助的,我是尝试了很多职位这一点,但我的问题还是没有解决,我对Android的新手。我尝试学习材料的设计,我采用Android棒棒糖,API等级22。

Sorry maybe this is not new topic, but really need help, i was try many post about this, but my problem still not fix, i am newbie about android. I try to learn Material Design, i use android lollipop, API level 22.

我尝试使用编译com.android.support:support-v4:22.0.0。同步后gradle这个,我还是不能够使用 Theme.AppCompat.Light.NoActionBar 作为我的主题 style.xml 文件。这是我的gradle完全文件:

i try to use compile 'com.android.support:support-v4:22.0.0'. After sync the gradle, i still not able to use Theme.AppCompat.Light.NoActionBar as my theme on style.xml file. This is my completely gradle file:

apply plugin: 'com.android.application'
 android {
    compileSdkVersion 22
    buildToolsVersion '22.0.1'

    defaultConfig {
        applicationId "afnan.project.com.materialdesign"
        minSdkVersion 21
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
 dependencies { 
 compile fileTree(dir: 'libs', include: ['*.jar'])
 com.android.support:support-v4:22.0.0'
} 

有另一种设置,这样我就可以尝试使用这个主题,或主要问题是什么?请告诉我,需要咨询..

is there another settings so i can try to use this theme, or what is the main problem? pls tell me, Need advice..

推荐答案

要使用应用程序兼容性主题,你必须在项目中包含这个库。

To use the AppCompat Theme you have to include this library in your project.

 compile 'com.android.support:appcompat-v7:22.2.0'

此外,我建议你使用最新版本22.2.0,而不是22.0.0

Also I suggest you using the last version 22.2.0 instead of 22.0.0

dependencies { 
     compile fileTree(dir: 'libs', include: ['*.jar'])
     compile 'com.android.support:appcompat-v7:22.2.0'

     //You can remove this line, because the appcompat has the support-v4 as dependency
     //com.android.support:support-v4:22.0.0'
    } 

这篇关于Theme.AppCompat.Light.NoActionBar在Android工作室找不到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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