【发布时间】:2015-11-14 14:57:31
【问题描述】:
我在 xaml 中定义了一个默认网格控件:
<Page
x:Class="App.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid>
</Grid>
</Page>
而且这个网格不是从页面顶部开始的,如下图所示:
实现此目的的一种方法是设置负边距,如下所示:
<Page
x:Class="App.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid Margin="0,-26.667,0,0">
</Grid>
</Page>
所以它看起来像这张照片:
不过,我看过 Bob Tabor 的一些视频,例如 this one,他的所有默认控件都是从页面顶部开始的。
这里有什么问题,在不设置负边距的情况下如何解决?
【问题讨论】:
标签: c# xaml windows-phone-8.1