2

我遇到了对齐问题,我试图从头到尾定位标签,但它们从中间开始。有人可以阐明我需要做些什么来改变它并让它按照我想要的方式对齐。

在此处输入图像描述

        <Grid Height="23.3" Margin="169,0,8,8.199" VerticalAlignment="Bottom" Width="Auto">
<Grid.ColumnDefinitions>
    <ColumnDefinition Width="*" />
    <ColumnDefinition Width="*" />
    <ColumnDefinition Width="*" />
    <ColumnDefinition Width="*" />
    <ColumnDefinition Width="*" />
    <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
            <Rectangle Grid.ColumnSpan="6" Fill="#FFDDDDDD" Stroke="#FFD7D7D7" RadiusX="2" RadiusY="2"/>


            <Label Grid.Column="1" Grid.Row="1" x:Name="lblAbout" Content="{Binding Source={StaticResource localisation}, Mode=OneWay, Path=.[Language.about]}" HorizontalAlignment="Left" Foreground="#FF585858" FontSize="10" Cursor="Hand" d:LayoutOverrides="Height" MouseLeftButtonUp="lblAbout_MouseLeftButtonUp"/>
            <Label Grid.Column="2" Grid.Row="1" Content="{Binding Source={StaticResource localisation}, Mode=OneWay, Path=.[Language.settings]}" HorizontalAlignment="Left" Foreground="#FF585858" FontSize="10" Cursor="Hand" d:LayoutOverrides="Height"/>
            <Label Grid.Column="3" Grid.Row="1" Content="{Binding Source={StaticResource localisation}, Mode=OneWay, Path=.[Language.feedback]}" Foreground="#FF585858" FontSize="10" Cursor="Hand" HorizontalAlignment="Left" Width="Auto" d:LayoutOverrides="Height"/>
            <Label Grid.Column="4" Grid.Row="1" Content="{Binding Source={StaticResource localisation}, Mode=OneWay, Path=.[Language.help]}" Foreground="#FF585858" FontSize="10" Cursor="Hand" HorizontalAlignment="Left" Width="Auto" d:LayoutOverrides="Height"/>
            <Label Grid.Column="1" Grid.Row="1" Content="{Binding Source={StaticResource localisation}, Mode=OneWay, Path=.[Language.checkingUpdates]}" Foreground="#FF585858" FontSize="10" Cursor="Hand" d:LayoutOverrides="Height" Visibility="Collapsed"/>
        </Grid>
4

1 回答 1

3

现在,由于您的所有列都使用星号大小,因此它们都将均匀调整大小并在宽度上拉伸。

我相信你想要:

<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />

这将导致它们从左到右堆叠,并在最后“填充”。

于 2012-06-08T18:13:59.490 回答