移动视图中的uwp网格视图的上半部分显示空白

时间:2016-09-08 05:46:17

标签: view grid uwp uwp-xaml

我为移动设计了一个uwp应用,上层网格和屏幕截图之间的移动视图中有空间

Sample

任何人都可以帮助我消除移动视图中的空白

下面的代码

<Page
    x:Class="CustomSplash.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:CustomSplash"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    Height="Auto">

    <Grid Name="mainGridView">
        <Grid.Background>
            <ImageBrush  ImageSource="Assets/info_bg.png"/>
        </Grid.Background>
        <Grid.RowDefinitions>
            <RowDefinition x:Name="rowDefSubjectHeadingGrid" Height="2.8*"/>
            <RowDefinition x:Name="rowDefSubjectListGrid" Height="4.4*"/>
            <RowDefinition x:Name="rowDefButtonGrid" Height="0.8*"/>
        </Grid.RowDefinitions>
        <Grid Grid.Row="0" Background="#339FFE">
            <Image Source="Assets\ic_nytra_logo.png" Margin="90,10,124,60" />
        </Grid>
        <Grid Grid.Row="1">
            <StackPanel Orientation="Vertical" HorizontalAlignment="Center"  Width="354"  Height="336">
                <Rectangle Fill="#303030" Width="335" Height="170" Margin="5"/>
                <Canvas Margin="120,-137,136,20">
                    <Image x:Name="extendedSplashImage" Source="Assets/ic_play.png" Height="100" Width="100" />                    
                </Canvas>
                <TextBlock Text="Toll Free No."
                    Foreground="#303030"  
                    FontSize="17"
                    FontFamily="Koblenz Serial Medium" 
                    Margin="138,35,124,15" />
                <Image Source="Assets/ic_call.png"  Width="50" Height="50" Margin="-200,-20,10,10"/>
                <TextBlock Text="18002002233"
                    Foreground="#303030"  
                    FontSize="26"
                    FontFamily="Koblenz Serial Medium" 
                    Margin="110,-50,90,20" />                
            </StackPanel>
        </Grid>
        <Grid Grid.Row="2">
            <Image Source="Assets\info_footer.png"  Stretch="Fill" />
            <TextBlock Text="Sign in" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="4,4,200,3" FontSize="32"/>
            <TextBlock Text="Sign up" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="190,4,10,3" FontSize="32"/>
        </Grid>
    </Grid>    
</Page>

1 个答案:

答案 0 :(得分:0)

只有hide the status bar差距将消失。

public RemoveGap()
{
    this.InitializeComponent();
    StatusBar.GetForCurrentView().HideAsync();
}

注意,要使用此课程,我们需要添加移动特殊参考,如下图所示: enter image description here