12

It used to work from time to time, but now the ability to zoom in/out on the layout design page is completely gone for me. The layout view always stays at 10% zoomed in and doesn't change no matter what I do. Oddly, the preview tab with exactly the same content zooms just fine.

This problem happens across all my projects and layout files, I tried restarting both the app and my computer numerous times, changing the theme from Dracula to IntelliJ and then back, and of course, tried the "invalidate cache and restart" option, but none of them worked. Am I doing something wrong?

I'm using Android Studio 3.2.1 Build #AI-181.5540.7.32.5056338, built on October 8, 2018

Just for reference, here's a screenshot of the design editor page, which stays like that all the time.

XML Editor Design Tab Screenshot

Jack
  • 5,354
  • 2
  • 29
  • 54
  • Iff the layout is a `ConstraintLayout`, CMD(Ctrl) + Mouse Wheel can zoom in/out. This works sometimes. – Dewey Reed Dec 18 '18 at 03:11
  • I should mention that I did try that, and it doesn't work. Used to work a while back though. – Jack Dec 18 '18 at 03:11
  • I am using the same build, but it is working for me. try zooming using the buttons in action bar next to warning icons. – karan Dec 18 '18 at 06:46
  • @KaranMer I tried that before but it didn't work. – Jack Dec 18 '18 at 08:39
  • try closing your project and instead of open re import it from new import project and select your project again. – karan Dec 18 '18 at 08:41
  • Problem solved, I changed the device for preview. Thanks anyways. – Jack Dec 18 '18 at 08:44

8 Answers8

17

It happens from time to time in Android Studio 3. This are steps to try to resolve this issue:

  • invalidate cache and restart studio;
  • choose different emulator from drop-down menu;
  • refresh layout by clicking on eye icon at the top of layout designer view.
Arthur
  • 769
  • 7
  • 17
  • 1
    By choosing different emulator, I think you mean to choose a different device for preview. I tried that and it worked, thanks! So far I have tried all the different devices, all of them worked except for Pixel 2 XL, weird. – Jack Dec 18 '18 at 08:43
  • @jackz314 that's a bug in Android Studio 3. Not sure how it connected to Pixel 2 XL (actually not only to that, but to some emulators configurations ether) but everything is needed to fix it - choose different emulator layout – Arthur Dec 18 '18 at 09:49
14

The best fix that worked for me was to minimize all the tools on the bottom, i.e Run, Logcat, TODO, Terminal, Build and more ... Then the zoom buttons start working. Even you open the tools back again, the zoom will keep working.

My complete answer is here:

Bilal Rabbani
  • 1,288
  • 14
  • 24
  • 2
    can confirm this issue exists and fix works for android studio version 3.3.2 – Karan Harsh Wardhan Apr 01 '19 at 06:54
  • 1
    I can confirm this issue still exists and the fix works for android studio 3.4. My suspicion is that it, as well as the other ones that involve rearranging or floating windows work because they force a resize. No idea why switching emulators appears to work. – MikeF May 16 '19 at 12:48
5

I am having the same problem on Androd Studio 3.3.1. The solution is a bit silly. Every time the zoom stops working I drag the bottom area (where you have the logcat/build/run) all the way to the top, so it hides your xml. Then drag it back down.

The zoom will start working again.

avelozo
  • 106
  • 1
  • 3
1

Try changing the device from pixel 2 to something else! Changing the device worked for me. Try clicking on the zoom (+) button after changing the device!

joekevinrayan96
  • 564
  • 10
  • 25
0

Sometimes zooming is freezed when logcat is displayed, so turning logcat on/off often unfreezes zooming.

0

I changed the theme from IntelliJ to Darcula and it worked for me. For some people it has worked the other way round.

Azaz Sayed
  • 53
  • 7
0

click on logcat and then again minimize it then the zoom will start working again!!

0
  • Click on the Design Surface button (or press B inside a xml design editor)
  • Select some different design or Force Refresh Layout (or press R).

Demo

Borzh
  • 5,069
  • 2
  • 48
  • 64