Android Studio布局预览未显示设计 [英] Android Studio Layout preview not showing design

查看:152
本文介绍了Android Studio布局预览未显示设计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在一个项目上,一切都很好.今天,当我打开android studio时,设计/布局预览仅显示白屏. (就像图片一样)

I am currently working on a project and everything was fine. Today, while I opened android studio, the design/layout preview showing white screen only. (Like the picture)

我确实尝试过:

  1. 使缓存无效并重新启动
  2. 强制布局刷新
  3. 将appcombat降级到27.1.1
  4. 在style.xml中添加Base.Theme

但是,没有任何效果. 没有构建错误,可以在模拟器中正常运行,并且可以在模拟器中进行设计显示,但不能在android studio中运行.

But, nothing worked. No Build errors, runs fine in emulator and design shows in emulator, but not in android studio.

任何解决方案都会有很大帮助,如果您需要更多详细信息,也请告诉我.

Any solution would be a great help, also let me know if you need more details.

即使具有Hello World布局的新项目也显示相同.尝试过,卸载并安装Android Studio.

Even a new project with Hello World layout appears same. Tried, uninstalling and installing Android Studio.

推荐答案

我不知道出了什么问题,但是下面的步骤解决了我的问题:

I don't know what was wrong, but below steps solved my problem:

  1. 从C:/Users//.grade/caches清除缓存文件夹
  2. 从C:/Users//.AndroidStuido3.x/system/caches清除缓存文件夹
  3. 重新启动Android Studio
  4. 清理构建项目

经过数小时的试验并经历了许多解决方案,这才是真正有效的解决方案.

After hours of experimenting and going through lots of solutions, this was the one that actually worked.

希望以后遇到此问题的任何人都会发现这很有帮助.

Hope anyone in the future faces this problem will find this helpful.

这篇关于Android Studio布局预览未显示设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆