问题
When I open an activity layout on Layout Preview, I want to zoom in but when I click to zoom in button nothing happens. Also, zoom out and zoom to fit screen buttons not working.
What I tried:
- Updated Android Studio to version 3.3.
- Done all Android SDK updates.
- Updated NDK.
- Clean Project.
- Rebuild Project.
- Create a new project.
How can I fix this problem?
Edit:
I think I found the solution. If your zoom level on 24%, zoom in and zoom out buttons not working. To fix the bug, lower layout preview window size till zoom level become 23% and lower. After this, zoom buttons starts to work again.
Screenshots: https://prnt.sc/mgkphw | https://prnt.sc/mgkpxu
回答1:
It is a bug in Android Studio; at some zoom levels (e.g 24% or 9% or whatever) the zoom buttons stop working. One fix is to keep changing the 'Device for Preview' type and find the one on which zoom buttons work.
But 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.
Just to verify the solution; re-open one of the bottom tools (e.g Logcat) and click 'Zoom to fit screen (ctl+0)', most likely the zoom buttons will stop working again. Simply minimize the tools again and it's fixed.
来源:https://stackoverflow.com/questions/54256336/android-studio-3-3-layout-preview-zoom-in-zoom-out-and-zoom-to-fit-screen-but