zoukankan      html  css  js  c++  java
  • Failed to load AppCompat ActionBar with unknown error

    前言

    今天安装写一个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">
    
  • 相关阅读:
    KVM安装以及远程连接
    开博客祭
    CQOI 2021
    琐记——学长们
    大事祭
    关于洛谷与博客园的博客的一些声明
    CSP-S 2020 & NOIP 2020 日记与游记
    调和级数
    快速乘
    二叉堆
  • 原文地址:https://www.cnblogs.com/aoximin/p/12221230.html
Copyright © 2011-2022 走看看