【问题标题】:Center Content XAML中心内容 XAML
【发布时间】:2014-01-06 21:29:51
【问题描述】:

如何在 XAML Windows 8.1 上使元素居中?在全屏应用星号后设置边距时,我看到:

<ProgressRing   Name="Load" 
                IsActive="True" 
                HorizontalAlignment="Stretch"
                Margin="672,373,674,373" 
                VerticalAlignment="Stretch" 
                Foreground="White"/>

<TextBlock  Margin="528,466,526,256" 
            TextWrapping="Wrap" 
            Text="Caricamento..." 
            FontSize="50" 
            IsRightTapEnabled="False" 
            IsHoldingEnabled="False" 
            IsDoubleTapEnabled="False" 
            IsTapEnabled="False" 
            Foreground="White"/>

在程序员模式下,我看到了这个:

【问题讨论】:

  • horizo​​ntalALignment = "center"?
  • 使用居中水平和垂直对齐并移除边距

标签: c# windows xaml


【解决方案1】:

试试这个,使用HorizontalAlignmentVerticalAlignment 中心。而不是利润。

<ProgressRing   Name="Load" 
                IsActive="True" 
                HorizontalAlignment="Center"
                VerticalAlignment="Center"
                Foreground="White"/>

<TextBlock  TextWrapping="Wrap" 
            Text="Caricamento..." 
            FontSize="50" 
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
            IsRightTapEnabled="False" 
            IsHoldingEnabled="False" 
            IsDoubleTapEnabled="False" 
            IsTapEnabled="False" 
            Foreground="White"/>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-05-26
    • 2011-07-03
    • 2010-10-27
    • 2018-01-17
    • 2013-10-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多