问题
I am using Android Studio
latest version and recently facing a problem that, my layout xml Design
view not getting updated rapidly if I have changed background from selector
resource or changed the image resource background
. I found that Rebuild Project
again updating the layout. But my project is little big and its taking some time to rebuild again. It would be nice if there is any other quick solution for this. I have also tried the Synchronize xml option, but not worked as expected. Please suggest me if there is any better option. Thanks.
回答1:
If problem persist just follow these steps:
File> Invalid cache/Restart > Invalidate and Restart
It will then surely work.
回答2:
Not sure when they added this but you can force the layout to refresh in the Design/Blueprint toggle menu (see below). This fixed the issue for me.
回答3:
I was also struck in the same problem and the Temporary and working solution is to change the preview device. If you want you can also switch to the previous device. Layout will be updated.
Sorry for being Late
回答4:
uncheck "Skip installation if APK has not changed":
回答5:
I guess changing the tabs will refresh the layout. Try this. Hope this helps.
回答6:
one time colse that file and open it again may be its reflected your changes if its not work than one time run your app and after changes of of your xml file its reflected in preview.
来源:https://stackoverflow.com/questions/39941222/android-studio-layout-xml-not-updating