[置顶] 【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布局
是否解决了你的问题呢?
相关文章推荐
- AndroidStudio xml不显示内容出现:Rendering Problems The following classes could not be instantiated
- The following classes could not be instantiated: android.support.v7.widget.RecyclerView v7中找不到的终极方法
- The following classes could not be instantiated: - android.support.v7.internal.widget.ActionBarOverl
- The following classes could not be instantiated: - android.support.v7.widget.Toolbar 解决方法
- [Android] 升级了新的android studio之后 发生如下的报错,The following classes could not be instantiated:
- [Android Exception A] – 1-The following classes could not be instantiated
- The following classes could not be instantiated: - android.support.v7.widget.Toolbar 解决办法
- 安卓错误提示:The following classes could not be found: - LinerLayout
- The following classes could not be found: - android.support.v7.internal.widget.ActionBarOverlayLayout
- The following classes could not be found: - android.support.v7.internal.widget.ActionBarOverlayLayou
- The following classes could not be found - EditText (Change to android.widget.EditText, Fix Build Pa
- 最近一个工程出现的问题 以前工程可用的代码到这个工程里也会显示 The following classes could not be found: - ImageView (Change to and
- 加载百度地图MapView出现The following classes could not be instantiated
- The following classes could not be found: - android.support.v7.internal.widget.ActionBarOverlayLayou解决方案
- 解决方案-Rendering Problems-The following classes could not be instantiated:
- The following classes could not be found: - android.support.v7.internal.app.WindowDecorActionBar
- The following classes could not be found: - android.support.v7.internal.widget.ActionBarOverlayLayou
- The following classes could not be instantiated
- Android Studio常见错误之:Rendering Problems/The following classes could not be instantiated
- 『Android/Java』Android Studio XML Editor Preview Error:The following classes could not be found