android studio 预览不显示?版本 1.5.1 [英] android studio preview not displaying? version 1.5.1
问题描述
最近几周我一直在使用 Android Studio,短暂休息后我决定开始一个新项目.在此之前,一切正常.
I have been using Android Studio quite a lot in recent weeks, and after a short break I decided to start a new project. Before this point, everything was working fine.
我的问题是预览未以文本或设计形式显示.如果我运行模拟器,就可以看到我的项目.
My issue is that the preview is not displayed in text or design. If I run an emulator, my project can be seen.
这是一个全新的项目,我还没有输入一行代码.
This is a brand new project, I have yet to type a single line of code.
我已经卸载了 android studio 并重新安装了它,我重建了项目,我清理了项目,我创建了新项目,我安装了所有可用的 SDK,我已经使缓存无效/重新启动.
I have uninstalled android studio and reinstalled it, I have rebuilt the project, I have cleaned the project, I have created new projects, I have installed every SDK available to me, I have invalidated caches/restarted.
我尝试了多个主题.我试过多个安卓版本.我尝试了多种设备.
I've tried multiple themes. I've tried multiple android versions. I've tried multiple devices.
谁能告诉我如何解决这个问题?
Can someone please tell me how to fix this?
编辑
问题已通过删除这行代码得到解决:
Problem has been fixed by deleting this line of code:
"tools:shownIn="@layout/activity_main"
我以前从未在项目中看到过这种情况...谁能解释一下为什么会发生这种情况?
I have never seen this in a project before... Can anyone shed some light onto why this happened?
推荐答案
我遇到了同样的问题.我在我的 .xml 文件中没有看到这行代码.但是我将 Theme 更改为 Material 并解决了我的问题.
I had the same issue. I don't see in my .xml file this line of code. But I changed Theme to Material and that solved my case.
同样的问题,但其他原因.
The same problem, but other reasons.
在这里找到信息:https://www.quora.com/Design-view-is-not-getting-displayed-in-my-Android-Studio-What-should-I-do
这篇关于android studio 预览不显示?版本 1.5.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!