您的位置:首页 > 移动开发 > Android开发

[置顶] 【Android】AndroidStudio开发工具布局xml文件不显示视图。提示:The following classes could not be instantiated:

2017-01-06 14:40 621 查看
作者:程序员小冰 (转载请说明出处)博客地址:http://blog.csdn.net/qq_21376985


当我们新建项目的时候,有时候会遇到xml布局不显示的问题,比如这个问题,错误代码如下:

The following classes could not be instantiated:


等等一大片,具体看下面截图:



如果你遇到的大概也是这样,从提示可以看出是v7包下的toolbar,所以,我们可以更改我们的style文件。也就是value/style.xml文件。我这里的主题是

`  <!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>`


我这里是引用的DarkActionBar。我们只需将它更改为NoActionBar即可。。然后再去看一下xml布局

是否解决了你的问题呢?
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐