Android Studio 3.3、布局预览、放大、缩小和缩放以适应屏幕按钮不起作用

人气:724 发布:2022-10-16 标签: android-layout android-studio android-studio-3.3

问题描述

当我在布局预览中打开一个活动布局时,我想放大但是当我点击放大按钮时没有任何反应.此外,缩小和缩放以适应不起作用的屏幕按钮.

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.

将 Android Studio 更新至 3.3 版.完成所有 Android SDK 更新.更新了 NDK.清理项目.重建项目.创建一个新项目.

我该如何解决这个问题?

How can I fix this problem?

我想我找到了解决方案.如果您的缩放级别为 24%,放大和缩小按钮不起作用.要修复该错误,请降低布局预览窗口的大小,直到缩放级别变为 23% 或更低.在此之后,缩放按钮再次开始工作.

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.

截图:https://prnt.sc/mgkphw |https://prnt.sc/mgkpxu

推荐答案

Android Studio 中的一个 bug;在某些缩放级别(例如 24% 或 9% 或其他)缩放按钮停止工作.一种解决方法是不断更改预览设备"类型并找到缩放按钮可以使用的类型.

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.

但是对我有用的最佳解决方案是最小化底部的所有工具,即运行、Logcat、TODO、终端、构建等等......然后缩放按钮开始工作.即使您再次打开工具,缩放也会继续工作.

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.

只是为了验证解决方案;重新打开底部工具之一(例如 Logcat)并单击缩放以适应屏幕(ctl + 0)",很可能缩放按钮将再次停止工作.只需再次最小化工具即可修复.

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.

171