本文介绍了Android 模拟器屏幕尺寸与设备框架不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行模拟器时,屏幕尺寸小于设备框架,如下图所示.它只发生在屏幕分辨率为 3840 x 2160 的计算机中

When I run the emulator the screen size is smaller than the device frame as in the image below. It only happens in a computer with a screen resolution of 3840 x 2160

推荐答案

这肯定行得通

您可以通过简单地让窗口覆盖缩放设置来解决使用硬件渲染时的缩放问题.怎么样?,很简单.只需找到您正在使用的模拟器的 .exe 文件(例如,ARM 的qemu-system-armel.exe"和 x86 的qemu-system-x86_64.exe").要确定是哪个 .exe 文件,只需运行模拟器,然后使用任务管理器找到正在运行的 .exe 文件,请参见屏幕截图.使用任务管理器找到 .exe 文件

You can fix the scaling issue when using the Hardware rendering by simply making windows override the scaling setting. How?, it's very easy. Simply locate the .exe file for the emulator that you are using, (e.g. "qemu-system-armel.exe" for ARM and "qemu-system-x86_64.exe" for x86). To make sure which .exe file, just run the emulator then use task manager to locate the .exe file is running, see the screenshot. locate the .exe file using task manager

就我而言,它位于以下位置:"C:Users[Username]AppDataLocalAndroidSdkemulatorqemuwindows-x86_64qemu-system-x86_64.exe"

In my case it was in this location: "C:Users[Username]AppDataLocalAndroidSdkemulatorqemuwindows-x86_64qemu-system-x86_64.exe"

现在只需右键单击文件,然后单击属性,然后选择兼容性";标签.在设置"下在底部,单击更改高 DPI 设置".将打开一个新窗口.勾选最后一个复选框覆盖高 DPI 缩放行为".在高 DPI 缩放覆盖"下.然后从它下面的下拉菜单中选择系统".(这非常重要,否则不会有任何区别!),请参见下面的屏幕截图.现在只需点击 OK 和 OK.重启Android Studio就可以了,问题解决了:)

Now just right click on the file then click on properties then choose the "Compatibility" tab. Under "Settings" at the bottom, click on "Change high DPI settings". A new window will open. Tick the last checkbox "Override high DPI scaling behavior." under "High DPI scaling override". Then select from the drop down below it "System" (this is very important or it will not make any difference!), see the screenshot below. Now just hit OK and OK. Restart Android Studio and that's it, problem solved :)

这篇关于Android 模拟器屏幕尺寸与设备框架不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 00:57