禁用UWP App的缩放比例 [英] Disable Scaling for UWP App

查看:286
本文介绍了禁用UWP App的缩放比例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Windows 10自动将比例因子应用于UWP应用,以在多个设备上提供相似的有效像素大小.

Windows 10 automatically applies a scale factor to UWP apps, to give a similar effective pixel size across multiple devices.

我希望我的UWP UI在相同分辨率的任何屏幕上看起来都一样,而不管比例因子如何.这可能吗?

例如,在Hololens上运行我的应用程序时,它将应用150%的比例因子.这意味着与具有类似分辨率(1280x720)的桌面屏幕相比,UI看起来很紧凑.

For instance, when running my app on the Hololens it applies a 150% scale factor. This means the UI looks squished when compare to a desktop screen of a similar resolution (1280x720).

建议(如何在UWP移动版上禁用自动缩放)表示要在 ApplicationViewScaling类上使用TrySetDisableLayoutScaling . 但这是行不通的.该文档说它仅适用于Xbox.

A suggestion (How to disable auto-scaling on UWP mobile) says to use TrySetDisableLayoutScaling on the ApplicationViewScaling Class. But this doesn't work. The documentation says it only works for Xbox.

另一种可能性是应用比例转换(如何以编程方式缩放Windows通用桌面应用).但是,我将不得不根据设备应用不同的比例,以否定自动应用的比例因子窗口.但这并不理想.

Another possibility is to apply a scale transform (How to scale a windows universal desktop app programatically). However, I would have to apply a different scale, depending on the device, to negate the scale factor windows automatically applies. But this is not ideal.

似乎我唯一的选择是为每个设备系列制作不同的UI,并考虑到不同的比例因子.

It seems my only option is to make different UIs for each device family, that take into account the different scale factors.

我很惊讶没有办法只是关闭电源! 任何帮助将不胜感激.

I am suprised there is no way to just turn is off! Any help would be greatly appreciated.

推荐答案

当前仅在Xbox设备上可以禁用布局缩放.

Disabling the layout scaling is currently only possible for the Xbox devices.

这已由 ApplicationViewScaling 类文档,其中指出:此方法在Xbox以外的设备上总是返回false".

This is confirmed by the ApplicationViewScaling class documentation which states, "This method will always return false on devices other than Xbox".

我创建了一个请求,允许Hololens这样做.您可以在这里投票: https: //wpdev.uservoice.com/forums/110705-universal-windows-platform/suggestions/32441581-disable-layout-scaling-hololens-trysetdisabl

I have created a request to allow this for the Hololens. You can vote for it here: https://wpdev.uservoice.com/forums/110705-universal-windows-platform/suggestions/32441581-disable-layout-scaling-for-hololens-trysetdisabl

这篇关于禁用UWP App的缩放比例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆