简体   繁体   中英

How to refresh preview on Android Studio 2.2?

Now on Android Studio 2.2 on new Preview mode, there are no more refresh button :

在此处输入图片说明

  • Image 1: Preview on Android Studio 2.2 (without refresh button)
  • Image 2: Preview on Android Studio 2.1 (with refresh button)

Does anyone know how to display it again? Or with shortcut maybe?

Edit: If I change a drawable by example and that the change does not appear in the layout, the only method that works for me is closed and restart the project. If I close the layout and as I re-opens nothing happens. Same result using the "Synchronized" button.

Refresh feature is not removed, it is there; It's pretty simple to refresh:

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

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

I think it is a small bug. But I find a hack solution to resolve the problem, you can modify the 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 that:

在此处输入图片说明

next step, click refresh icon(sometimes it is 'clear cache' label). it is works for me.

I have try to change the orientation, but it not works when I replace a exist image file.

May your problem is same as : http://stackoverflow.com/questions/39646639/android-studio-2-2-layout-editor-refresh-button

Display again?

I guess you cant. Apparently the refresh functionality has been removed because they think the processing will happen much faster and will auto-refresh the previews real time. The Layout Editor's document has no mention of refresh functionality.

Shortcut?

If you are faster in making changes to your layout than Android-studio refreshes, you could try toggling between the design and blueprint views using the shortcut B

Refer the Layout Editor Official Documentation for other shortcuts you might feel comfortable with or works for you.

There is no refresh button in stable version of android studio 2.2 for preview. But there is a work around to do so. By toggling the orientation button in an editor will refreshes the changes!

So do the Simple Step. When you change your layout then save it and clean your project. go to menu Build -> Clean Project.

I Hope this will help you.

我也有同样的问题,有时更改 Android 版本会起作用,如果您清理/重建项目,它肯定会起作用

Find the double diagonal lines below your preview layout and click them. It will refresh your layout.

双对角线

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM