0

我正在开发一个Windows Phone 7应用程序。

我想在 ListBoxItem 内垂直居中文本块。这是我的 XAML 代码:

<ListBoxItem x:Name="SingleGameItem" Height="79" Margin="10,5">
    <TextBlock HorizontalAlignment="Center" Height="31" Margin="5" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Center" Width="431" TextAlignment="Center"/>
</ListBoxItem>

我怎样才能做到这一点?

4

1 回答 1

0

解决方案是:

<ListBox x:Name="Options" Margin="12,8,8,8" Grid.Row="1">
    <ListBoxItem x:Name="SingleGameItem" Height="79" Margin="10,5" VerticalAlignment="Center">
        <TextBlock HorizontalAlignment="Center" Height="31" Margin="5" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Center" Width="431" TextAlignment="Center"/>
    </ListBoxItem>
</ListBox>

对不起。

于 2011-04-11T15:27:03.643 回答