Android Studio Can't Zoom in/out in Layout Editor

15,226

Solution 1

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.

Solution 2

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:

Solution 3

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.

Solution 4

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!

Solution 5

Drag the activity out of the main Android Studio window so it is detached from it.

After that I encountered a problem that my table wouldn't load. Resizing fixed that.

Share:
15,226
Jack
Author by

Jack

CS student. Loves android. Currently working on android, python, javascript, and webrtc.

Updated on June 08, 2022

Comments

  • Jack
    Jack about 2 years

    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
    Jack over 5 years
    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.
  • Arthur
    Arthur over 5 years
    @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
  • Karan Harsh Wardhan
    Karan Harsh Wardhan about 5 years
    can confirm this issue exists and fix works for android studio version 3.3.2
  • MikeF
    MikeF about 5 years
    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.