本文介绍了appcompat-v7:25.3.0:AppCompat不支持当前的主题功能:{windowActionBar:false,windowActionBarOverlay:false,. }的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在运行时遇到以下错误,并且该活动无法启动.错误显示在setContentView(R.layout.activity_main);,请帮助.

I am getting the following error while running and the activity does not start. The error is showing at setContentView(R.layout.activity_main); Please help.

我正在使用以下库:

compile project(':library')
compile 'com.google.android.gms:play-services-maps:10.2.0'
compile 'com.android.support:appcompat-v7:25.3.0'
compile 'com.android.support:design:25.3.0'
compile 'com.parse:parsetwitterutils-android:1.10.5'
compile files('libs/bolts-android-1.2.0-javadoc.jar')
compile files('libs/bolts-android-1.2.0.jar')
compile files('libs/listviewanimations_lib-core-slh_3.1.0.jar')
compile files('libs/listviewanimations_lib-core_3.1.0.jar')
compile files('libs/listviewanimations_lib-manipulation_3.1.0.jar')
compile files('libs/nineoldandroids-2.4.0.jar')
compile files('libs/Parse-1.9.1.jar')
compile files('libs/parse-android-1.13.3.jar')
compile files('libs/ParseCrashReporting-1.9.1.jar')
compile files('libs/picasso-2.5.0.jar')
compile files('libs/universal-image-loader-1.9.3.jar')

错误是:

推荐答案

Android开发人员在引入 AppCompatDialogs 高度依赖windowNoTitle标志-在22.1.0版本中.

Android developers have made AppCompat more restricted about windowNoTitle flag as they were introduces AppCompatDialogs which are highly dependent on windowNoTitle flag - in version of 22.1.0.

因此,要解决您的问题,请使用主题父级-Theme.AppCompat.NoActionBar

如果您的要求不适合此要求,请在需要的地方使用单独的主题-

So to fix your problem use your theme parent to - Theme.AppCompat.NoActionBar

If your requrement doesn't suite that, use separate theme where needed -

例如-

<style name="MyTheme" parent="Theme.AppCompat">
    ...
</style>

<style name="MyTheme.NoActionBar">
    <!-- both your properties are there -->
    <!-- Remove other ones.. i.e. windowActionBarOverlay and all -->
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
</style>

参考- Android开发者的博客

这篇关于appcompat-v7:25.3.0:AppCompat不支持当前的主题功能:{windowActionBar:false,windowActionBarOverlay:false,. }的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-16 04:31