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.
If problem persist just follow these steps:
File> Invalid cache/Restart > Invalidate and Restart
It will then surely work.
I had a similar issue. Mine ended up being caused by a duplicate layout file (in my case res/layout/activity_main.xml
and res/layout-v21/activity_main.xml
).
Turns out I enabled alternative resources for my layout, which created a copy of the layout for older API levels.
Reverting that change fixed it for me.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With