android studio 2.2 layout editor refresh button

16,067

Solution 1

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.

Solution 2

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.

Solution 3

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

Share:
16,067
drag
Author by

drag

Updated on June 24, 2022

Comments

  • drag
    drag about 2 years

    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.

  • twiceYuan
    twiceYuan almost 8 years
    @Subho I have replace an image and modify some words
  • drag
    drag almost 8 years
    actually this is what i found and have been using
  • drag
    drag almost 8 years
    night mode does nothing for me
  • Adam Staszak
    Adam Staszak over 7 years
    Change orientation sometimes do not work. This worked for me, thanks. Why they removed this button? Pointless...
  • Asaf Pinhassi
    Asaf Pinhassi over 7 years
    Worked for me. Cool.
  • Nikita Axyonov
    Nikita Axyonov over 7 years
    Doesn't update ImageViews if I change images in drawables directories. Android Studio 2.2.3
  • router
    router about 7 years
    Nothing worked for me. Sticking with closing the layout file and re-opening it :P
  • sunil
    sunil almost 7 years
    Works just fine :) Thanks for the tip
  • vovahost
    vovahost almost 7 years
    I don't get why they remove the Refresh button. The Layout Editor is always buggy.
  • vovahost
    vovahost almost 7 years
    Be sure to select an element in the Layout Editor in case pressing R doesn't refresh the layout.
  • Yazon2006
    Yazon2006 over 6 years
    It's not a solution. It's a workaround. This is the right way of how to refresh layout: stackoverflow.com/a/42059284/2557258
  • Mohammad Javadian
    Mohammad Javadian over 3 years
    I solve it by building app again. after a build UI back to normal.