问题
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:
- Invalidate Cache and Restart
- Force Layout Refresh
- Downgrading appcombat to 27.1.1
- 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:
- Clear caches folder from C:/Users//.grade/caches
- Clear caches folder from C:/Users//.AndroidStuido3.x/system/caches
- Restart Android Studio
- 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