Windows Store Metro APP如何适应屏幕尺寸

时间:2014-12-01 12:56:10

标签: c# windows windows-8 windows-store-apps microsoft-metro

我想知道如何让我的Metro Windows 8应用程序适应屏幕大小。 换句话说:有点敏感的设计。

通过Visual Studio 2013使用模拟器,我可以测试多个屏幕,看起来我的应用程序根本没有正常运行。

我还使用模拟器来了解一些Windows 8 / 8.1内置应用程序的表现:它非常出色。

我怎样才能做到这一点?

我已经找到了网格的部分答案:Windows 8 App Screen Layout

但这还不够。

这张照片显示了我要做的事情:

http://image.noelshack.com/fichiers/2014/49/1417438224-stack.png

无论屏幕解决方案是什么,我都需要保持横向模式的布局。

在Windows Phone中,它看起来像一个魅力:不需要做任何事情。

感谢您的帮助!

1 个答案:

答案 0 :(得分:1)

这是非常基本的XAML知识。

<Grid>
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="*"/>
    <ColumnDefinition Width="Auto"/>
    <ColumnDefinition Width="*"/>
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
    <RowDefinition Height="*"/>
    <RowDefinition Height="Auto"/>
    <RowDefinition Height="*"/>
    </Grid.RowDefinitions>


// Grid.Row="1" Grid.Column="1" - your grid with Login/Password. Use VerticalAligment="Center", HorizontalAligment="Center" 

// Grid.Row="2" Grid.Column="2" - your register button. Use VerticalAligment="Bottom", HorizontalAligment="Right"

</Grid>

我个人建议您将“注册”按钮作为“登录”按钮下的链接。

相关问题