android studio laylayout编辑器出错

来源:2-2 选择题

qq_哦呼_0

2018-09-02 19:47:43

编辑layout文件的时候,模拟显示器没有显示东西

出现这个错误

The following classes could not be instantiated:

- android.support.v7.widget.ActionBarContainer (Open Class, Show Exception, Clear Cache)

- android.support.v7.widget.ActionBarContextView (Open Class, Show Exception, Clear Cache)

- android.support.v7.app.WindowDecorActionBar (Open Class, Show Exception, Clear Cache)

 Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE.  If this is an unexpected error you can also try to build the project, then manually refresh the layout.  Exception Details java.lang.ClassNotFoundException: android.view.View$OnUnhandledKeyEventListener Copy stack to clipboard

还有这个:

Failed to load AppCompat ActionBar with unknown error.   Tip: Try to refresh the layout.

写回答

2回答

irista23

2018-09-04

在AndroidManifest.xml文件中找到application样式文件Theme

http://img.mukewang.com/climg/5b8df4d00001ce2706190289.jpg

对应找到styles.xml文件,将AppTheme改成如下红框中的,或者修改成Base.Theme.AppCompat.Light

http://img.mukewang.com/climg/5b8df55d0001292c07140262.jpg

0
hrista23
回复
hq_哦呼_0
h 应用没有找到AppTheme对应的主题,所以显示不出来
h018-09-04
共2条回复

好帮手慕雪

2018-09-03

build the project然后再刷新一下xml文件。log提示是加载AppCompat ActionBar出现了一个未知的错误,需要刷新一下layou页。或者你把ActionBar相关删掉。祝:学习愉快

0
hq_哦呼_0
h 还是不明白怎么弄,上面无法实例化v7包的错误不用管吗? 我新建了几个Helloword的基本的layout还是这个问题,相关actionBar怎么删掉啊?麻烦老师了
h018-09-04
共1条回复

0 学习 · 7235 问题

查看课程