【问题标题】:Is there a way to resize and center a UWP app?有没有办法调整 UWP 应用的大小和居中?
【发布时间】:2021-07-14 19:50:30
【问题描述】:

我正在编写一个小型 UWP 应用程序,它将从另一个应用程序(主应用程序)启动。我希望减小 UWP 应用的窗口大小。

我可以通过将下面注释的代码添加到 App 构造函数中来更改窗口大小。但是在更改窗口大小后,我无法弄清楚如何制作 UWP 应用程序中心屏幕。感谢您提供有关制作 UWP 中心屏幕的任何建议。

public App()
{
    this.InitializeComponent();
    this.Suspending += OnSuspending;
    ApplicationView.PreferredLaunchViewSize = new Size(600, 400); //added code
    ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize; //added code
} 

【问题讨论】:

    标签: c# xaml uwp


    【解决方案1】:

    有没有办法调整 UWP 应用的大小和居中?

    没有,恐怕没有API来设置UWP窗口的位置:

    [UWP] Change the position of window close proximity to the right edge of the screen

    UWP Window Placement

    How can I set the Windows position on startup

    【讨论】:

    • 感谢您的回答!
    猜你喜欢
    • 2021-08-30
    • 2021-03-14
    • 2021-11-27
    • 2021-12-27
    • 1970-01-01
    • 2012-10-19
    • 2012-03-11
    • 2021-12-31
    • 1970-01-01
    相关资源
    最近更新 更多