C# 制作轴';s收割台居中对齐

C# 制作轴';s收割台居中对齐,c#,xaml,windows-phone-8,C#,Xaml,Windows Phone 8,我试图使pivot的标题保持在中心位置(在图中,head1向左对齐)。我试图改变pivot的风格,但没有成功 这里是自定义样式(我尝试将HorizontalAlignment=“Center”添加到与pivot标题相关的每个位置,但两者都不起作用) 在Page.xaml中: <phone:Pivot Style="{StaticResource PivotStyle1}"> <phone:PivotItem x:Name="head1

我试图使pivot的标题保持在中心位置(在图中,head1向左对齐)。我试图改变pivot的风格,但没有成功

这里是自定义样式(我尝试将
HorizontalAlignment=“Center”
添加到与pivot标题相关的每个位置,但两者都不起作用)


在Page.xaml中:

        <phone:Pivot Style="{StaticResource PivotStyle1}">
            <phone:PivotItem x:Name="head1">
                <phone:PivotItem.Header>
                    <TextBlock Text="head1" FontSize="30" HorizontalAlignment="Center" TextAlignment="Center"/>
                </phone:PivotItem.Header>
                <Grid/>
            </phone:PivotItem>
            <phone:PivotItem x:Name="head2">
                <phone:PivotItem.Header>
                    <TextBlock Text="head2" FontSize="30" HorizontalAlignment="Center" TextAlignment="Center"/>
                </phone:PivotItem.Header>
            </phone:PivotItem>
            <phone:PivotItem x:Name="head3">
                <phone:PivotItem.Header>
                    <TextBlock Text="head3" FontSize="30" HorizontalAlignment="Center" TextAlignment="Center"/>
                </phone:PivotItem.Header>
            </phone:PivotItem>
            <phone:PivotItem x:Name="head4">
                <phone:PivotItem.Header>
                    <TextBlock Text="head4" FontSize="30" HorizontalAlignment="Center" TextAlignment="Center"/>
                </phone:PivotItem.Header>
            </phone:PivotItem>
            <phone:PivotItem x:Name="head5">
                <phone:PivotItem.Header>
                    <TextBlock Text="head5" FontSize="30" HorizontalAlignment="Center" TextAlignment="Center"/>
                </phone:PivotItem.Header>
            </phone:PivotItem>
        </phone:Pivot>


问题在于,所有头部元件只占用了所需的空间。因为它已经在各个方向上完全对齐了,所以如果您以不同的方式对齐它也没关系。您是否尝试过更改包含“head1”标签的textblock的大小?如果你这样做了,你应该能够看到一些变化。(我可能错了,还没有测试)在这个意义上是中心吗?你指的是页面?@Kulasangar是的,例如在我发布的图片中,“head1”必须在所有“head”之间(我想head4、head5在左边,head2、head3在右边)
        <phone:Pivot Style="{StaticResource PivotStyle1}">
            <phone:PivotItem x:Name="head1">
                <phone:PivotItem.Header>
                    <TextBlock Text="head1" FontSize="30" HorizontalAlignment="Center" TextAlignment="Center"/>
                </phone:PivotItem.Header>
                <Grid/>
            </phone:PivotItem>
            <phone:PivotItem x:Name="head2">
                <phone:PivotItem.Header>
                    <TextBlock Text="head2" FontSize="30" HorizontalAlignment="Center" TextAlignment="Center"/>
                </phone:PivotItem.Header>
            </phone:PivotItem>
            <phone:PivotItem x:Name="head3">
                <phone:PivotItem.Header>
                    <TextBlock Text="head3" FontSize="30" HorizontalAlignment="Center" TextAlignment="Center"/>
                </phone:PivotItem.Header>
            </phone:PivotItem>
            <phone:PivotItem x:Name="head4">
                <phone:PivotItem.Header>
                    <TextBlock Text="head4" FontSize="30" HorizontalAlignment="Center" TextAlignment="Center"/>
                </phone:PivotItem.Header>
            </phone:PivotItem>
            <phone:PivotItem x:Name="head5">
                <phone:PivotItem.Header>
                    <TextBlock Text="head5" FontSize="30" HorizontalAlignment="Center" TextAlignment="Center"/>
                </phone:PivotItem.Header>
            </phone:PivotItem>
        </phone:Pivot>