【已解决】找不到android.support.v7.internal.app.WindowDecorActionbar

来源:互联网 发布:工作流管理系统源码 编辑:程序博客网 时间:2024/05/22 11:54

问题描述:

Rendering Problems 

       The following classes could not be found: - android.support.v7.internal.app.WindowDecorActionBar (Fix Build Path, Create Class)

       Tip: Try to build the project.

附:

在学习中遇到问题时,依照前辈们的告诫“不会的先自己查,实在不行再来找前辈”,而最快捷的查询方法,是上网,本条将有幸成为网络经验之一。

找不到类 android...app.WindowDecorActionBar

工具/原料

  • Android Studio

问题原因

  1. 1

    Android版本升级,不推荐使用Actionbar,将被Toolbar代替。

    END

解决办法一:parent="Base.Theme.AppCompat.Light.DarkActionBar"

  1. 1

    找到项目目录res/values/sttyles.xml,准备修改其中的AppTheme设置。

    找不到类 android...app.WindowDecorActionBar
  2. 2

    找到属性parent="Theme.AppCompat.Light.DarkActionBar"

    找不到类 android...app.WindowDecorActionBar
  3. 3

    修改为parent="Base.Theme.AppCompat.Light.DarkActionBar",即在原parent属性值上加“Base.”前缀。

    找不到类 android...app.WindowDecorActionBar
  4. 4

    保存修改,回到问题提示的地方,现在是不是没有啦?

    找不到类 android...app.WindowDecorActionBar
    END

解决办法二: parent="Theme.AppCompat.Light.NoActionBar"

  1. 1

    同样在styles.xml文件中,修改parent属性值为"Theme.AppCompat.Light.NoActionBar"

    找不到类 android...app.WindowDecorActionBar
    END

解决办法三:换个低版本的API

  1. 1

    在问题提示页面,找到右上角的API选择按钮,可看到可选API列表。从中选择一个低版本的,如4.2.2

    找不到类 android...app.WindowDecorActionBar
  2. 2

    API切换成功后,可以看到不再显示问题。

    不过,不推荐使用此法。

    找不到类 android...app.WindowDecorActionBar
    END

注意事项

  • 推荐用Toolbar代替ActionBar
0 0
原创粉丝点击