作者:程序员小冰 (转载请说明出处)博客地址: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布局
是否解决了你的问题呢?