Android Studio 为何突出“主题"?style.xml 中的红色? [英] Why does Android Studio highlight "Theme" red in styles.xml?
本文介绍了Android Studio 为何突出“主题"?style.xml 中的红色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
红色高亮表示无法解析符号主题"
以下是一些配置:
styles.xml
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
<item name="android:windowNoTitle">true</item>
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<item name="android:windowNoTitle">true</item>
</style>
.
AndroidManifest.xml
AndroidManifest.xml
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="19" />
...
android:theme="@style/AppTheme">
.
build.gradle
build.gradle
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19.0.0'
}
...
android {
compileSdkVersion 19
buildToolsVersion '20.0.0'
defaultConfig {
applicationId 'com.mobile.slider'
minSdkVersion 8
targetSdkVersion 19
.
MainActivity.java
MainActivity.java
public class MainActivity extends Activity {
<小时>
它在我的手机 Nexus 4 上运行良好,其 android 版本是4.4.4.即使没有构建问题,NoTitleWindow 模式也不适用于
另一部具有 2.3.3 android 版本的手机.
It is working nice with my phone Nexus 4 whose android version is
4.4.4. Even though, There is no build problem, NoTitleWindow Mode doesn't work for
another phone which has 2.3.3 android version.
推荐答案
我是这样解决的:
- 转到您的项目目录(或项目视图)
- 进入
.idea
目录 - 删除
caches
和libraries
目录 - 文件 -> 使缓存无效/重新启动
现在应该可以了.
这篇关于Android Studio 为何突出“主题"?style.xml 中的红色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文