设置屏幕大小 [英] Setting screen size

查看:116
本文介绍了设置屏幕大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

出于某种原因,我的应用程序始终以全屏模式启动 - 本地计算机或模拟器。启动应用程序并调整大小并关闭它后,我再次启动它。我认为它从最后一个尺寸开始,但它仍然以全屏模式启动。

For some reason my app always starts in full screen mode - local machine or simulator. After starting the app and resizing it and closing it, I launch it again. I thought it'd start in the last size but it still starts in full screen mode.

在属性窗口中将宽度/高度设置为自动,并且没有设置明确的最小/最大宽度/高度。

Width/height are set to auto in properties window and there is no explicit min/max width/height set.

我甚至将ApplicationView.PreferredLaunchViewSize添加到OnLaunched(LaunchActivatedEventArgs e)但没有运气。我错过了什么吗?

I even added ApplicationView.PreferredLaunchViewSize to OnLaunched(LaunchActivatedEventArgs e) but no luck. Am I missing something?

谢谢,

Berk

推荐答案

嗨  berk_canc,

Hi berk_canc,

欢迎
到开发通用Windows应用程序论坛!
 请使用  标记 
发布到这个论坛,谢谢!

您可以按照以下步骤进行尝试。

You can have a try as the following steps.

1.在OnLaunched(LaunchActivatedEventArgs e)方法中,设置  ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize。

1. In the OnLaunched(LaunchActivatedEventArgs e) method, setting ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize.

2.当窗口大小发生变化时,例如 SizeChanged ,您可以使用  ApplicationView.PreferredLaunchViewSize    =
新尺寸(宽度,高度)来调整窗口大小并设置新尺寸);

2. When the windows size changed, such as in the SizeChanged, you can resize your windows size and set a new size by using ApplicationView.PreferredLaunchViewSize  = new Size(Width, Height);


这篇关于设置屏幕大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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