Android: cannot resolve appcompat-v7 themes

余生长醉 提交于 2019-12-07 04:17:09

问题


In themes.xml, I would like to change a theme from Theme.Holo.Light.DarkActionBar to Theme.AppCompat.Light.DarkActionBar

but I get:

cannot resolve symbol '@android:style/Theme.AppCompat.Light.DarkActionBar'

In the gradle file I added:

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

I am using:

compileSdkVersion 22
buildToolsVersion "22.0.1"

I have also run gradle's clean command, but nothing seems to change.

Any ideas?


回答1:


The AppCompat themes are not part of the built-in styles. You have to reference them without the '@android:style' prefix.

Just use something like:

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">


来源:https://stackoverflow.com/questions/30134295/android-cannot-resolve-appcompat-v7-themes

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