首页 > 移动平台 > 详细

Failed to load AppCompat ActionBar with unknown error

时间:2020-01-21 13:16:50      阅读:90      评论:0      收藏:0      [点我收藏+]

前言

今天安装写一个test的demo的时候,创建项目的时候出现这个错误。
然后我想啊,谁会去用这个actionBar啊,然后我找到main下的androidManifect.xml:

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/Theme.AppCompat.Light.NoActionBar">
    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name=".notificationActivity">
    </activity>
</application>

改成了:@style/Theme.AppCompat.Light.NoActionBar 反正我不使用就行呗,真正的项目谁会用这个东西哦。
然后就傻眼了,跳转到下一页,没有返回键。
看来还是要有一个bar的。

解决

在androidmanifect.xml 不变,还是android:theme="@style/AppTheme"
然后再style.xml中改下。
百度的:

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
改为:
<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">

Failed to load AppCompat ActionBar with unknown error

原文:https://www.cnblogs.com/aoximin/p/12221230.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!