Android Studio Layout preview not showing design

≯℡__Kan透↙ 提交于 2020-01-11 13:50:14

问题


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)

I did try:

  1. Invalidate Cache and Restart
  2. Force Layout Refresh
  3. Downgrading appcombat to 27.1.1
  4. Adding Base.Theme in style.xml

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.

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


回答1:


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

  1. Clear caches folder from C:/Users//.grade/caches
  2. Clear caches folder from C:/Users//.AndroidStuido3.x/system/caches
  3. Restart Android Studio
  4. Clean build project

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.




回答2:


Based on the screen shot it looks like the RelativeLayout you are using can't find the resource images like 'adminIcon'. If you click on that red badge of the icon it should have a text message behind it.

Did the artwork name of the images change? Do you see them in your res/drawable folder?




回答3:


I was also facing same issue resolved following this steps: https://www.youtube.com/watch?v=hMbIUVogWTo

In short answer is change appcompact-v7 "beta01" to "alpha1"




回答4:


Chenge the theme in the design screen,and you can see your perview.



来源:https://stackoverflow.com/questions/53175901/android-studio-layout-preview-not-showing-design

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!