AndroidStudio xml不显示内容出现:Rendering Problems The following classes could not be instantiated

使用AndroidStudio在写布局文件预览时出现下面情况:

 Rendering Problems The following classes could not be instantiated:
- 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.NullPointerException   at android.support.v7.app.WindowDecorActionBar.getDecorToolbar(WindowDecorActionBar.java:246)   at android.support.v7.app.WindowDecorActionBar.init(WindowDecorActionBar.java:202)   at android.support.v7.app.WindowDecorActionBar.<init>(WindowDecorActionBar.java:194)   at java.lang.reflect.Constructor.newInstance(Constructor.java:423)   at com.android.layoutlib.bridge.bars.AppCompatActionBar.<init>(AppCompatActionBar.java:89)   at com.android.layoutlib.bridge.impl.Layout.createActionBar(Layout.java:238)   at com.android.layoutlib.bridge.impl.Layout.<init>(Layout.java:150) Copy stack to clipboard   Failed to find the style corresponding to the id 2130772069 (22 similar errors not shown)  Failed to load AppCompat ActionBar with unknown error. (3 similar errors not shown)  Tip: Try to refresh the layout. 

出现这种情况,修改下style,然后clean一下,如果还是不行再invalidate cache/restart。


将parent修改如下添加一个Base属性:


操作了之后再进行预览看看。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值