【发布时间】:2016-07-04 02:15:19
【问题描述】:
我刚开始在 VS2015 社区版中开发通用 Windows 应用程序。我使用了名为 PieCharts for Windows UWP 的示例。
我的问题是我想将窗口大小固定为 400x650,就像我在旧桌面应用程序中所做的那样。我手动设置了宽度和高度它不起作用。我的 MainPage.xaml 类似于以下代码。
<Page x:Class="MyFistUWP.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:MyFistUWP"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
MaxHeight="650" MinHeight="650" MaxWidth="400" MinWidth="400" Height="650" Width="400" >
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="140" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Image Grid.Row="0" Source="Resources/my_logo.png" />
</Grid>
窗口大小错误,我可以调整窗口大小。
谢谢,
【问题讨论】:
-
请记住,UWP 应用程序可以在具有不同屏幕方向和大小的设备上运行,并且并非所有 UWP 平台都支持应用程序窗口化(例如电话)
标签: c# wpf visual-studio win-universal-app