36

can someone help me find the refresh layout button which was there before studio 2.2 to refresh the layout changes?

Have searched every where but cannot find it.The problem is sometimes drawables are not refreshed and reflected in the preview window.

Mir-Ismaili
  • 13,974
  • 8
  • 82
  • 100
drag
  • 421
  • 1
  • 5
  • 9
  • there is no refresh button in stable version of android studio 2.2 for preview or for that you need to downgrade to 2.1.2 version. – Amit Vaghela Sep 23 '16 at 08:54

5 Answers5

36

It's pretty simple to refresh.

Click on the preview screen, make sure that the preview window has the focus, and press R. It should display the progress in the top-right corner while refreshing.

If it doesn't work for any reason, switch to the design tab and press R. It refreshes the layout instantly.

Pang
  • 9,564
  • 146
  • 81
  • 122
Atiq
  • 14,435
  • 6
  • 54
  • 69
31

I think it is a small bug, but I find a hack solution to resolve the problem.

You can change a resource id to a wrong name. For example, you have a resource named ic_launcher. When you input ic_launcher1, you can find the interface like this:

sample screenshot

Next, click the refresh link (sometimes, it says 'clear cache').

I tried changing the orientation, but it does not work when I replace an existing image file.

Pang
  • 9,564
  • 146
  • 81
  • 122
twiceYuan
  • 863
  • 8
  • 11
19

Toggle the Orientation button in Editor, it is refreshing the changes.

user939997
  • 381
  • 1
  • 8
0

Can't seem to find the refresh layout button too, it's as if it is deliberately removed.

However, I found a temporary refresh layout solution: On the screen orientation button, click the dropdown and then change the Night Mode. See this page for reference on where to find the screen orientation button. Hope this helps.

JD Hernandez
  • 1,785
  • 1
  • 20
  • 29
0

Close edited layout file and reopen.

You can do this with following shortcuts:

  • Ctrl+F4 (close tab)
  • Ctrl+Shift+E (open Recently edited files)
  • Enter (select recent file to open, your layout file should be already highlighted if edited last)
Paweł Nadolski
  • 8,296
  • 2
  • 42
  • 32