0

私のページには次のコードがあります。

<Page
    x:Class="MyPage.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:MyProject"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    <ScrollViewer>
        <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
            <Grid.RowDefinitions>
                <RowDefinition Height="10*" />
                <RowDefinition Height="400*" />
            </Grid.RowDefinitions>
            <TextBlock Grid.Row="0" Text="Some Header" FontSize="48" Margin="100, 50, 0, 0" />
            <local:CustomGridView Grid.Row="1"  HorizontalAlignment="Left" Margin="100, 0, 0, 0" ItemsSource="{Binding CollectionOfYears}">
                <GridView.ItemsPanel>
                    <ItemsPanelTemplate>
                        <VariableSizedWrapGrid Orientation="Vertical" />
                    </ItemsPanelTemplate>
                </GridView.ItemsPanel>
                <GridView.ItemTemplate>
                    <DataTemplate>
                        <Grid Height="200" Width="200">
                            <Grid.Background>
                                <SolidColorBrush Color="{Binding Color}" />
                            </Grid.Background>
                            <StackPanel VerticalAlignment="Bottom">
                                <StackPanel.Background>
                                    <SolidColorBrush Color="Black" Opacity="0.5" />
                                </StackPanel.Background>
                                <TextBlock FontSize="24" Margin="10" TextAlignment="Center" Text="{Binding Year}" />
                            </StackPanel>
                        </Grid>
                    </DataTemplate>
                </GridView.ItemTemplate>
            </local:CustomGridView>
        </Grid>
    </ScrollViewer>
</Page>

今、私は私のページとして次の画像を取得します。

https://skydrive.live.com/redir?resid=59DBB22BE5D0430E!279

残りのスペース、つまりテキストブロックが塗りつぶされた後に残されたスペースをグリッドビューで埋めるにはどうすればよいですか? そして、最初のタイルの下の2番目のタイルを塗りつぶしながら、変数サイズラップグリッドを下に流すのではなく、正しく流すにはどうすればよいですか?

編集: グループで Windows ストアの完成を目指しています。1つの大きなアイテムと残りはそれを包むだけです.

4

1 に答える 1

0

わかった。問題を理解しました。

ステップ 1: スクロール ビューアーを削除します。

ステップ 2: グリッドの最初の行の高さを固定値に設定します。

ステップ 3: グリッドの 2 行目の高さを * に設定します。

ステップ 4: テキスト ブロックの余白を取り除きます。

ステップ 5: グリッド ビューでマージンの代わりにパディングを使用します。

これは、その一部を解決するのに役立ちます。

于 2012-11-07T16:02:33.050 に答える