Windows 8 Windows 8 XAML-使用VariableSizeWrapGrid的GridView存在问题
我的页面上有以下代码Windows 8 Windows 8 XAML-使用VariableSizeWrapGrid的GridView存在问题,windows-8,winrt-xaml,Windows 8,Winrt Xaml,我的页面上有以下代码 <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
<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>
现在,我得到以下图片作为我的页面
如何使gridview填充剩余空间,即填充文本块后留下的空间?然后,如何使variablesizewrapgrid正确流动,而不是向下流动,同时仍然填充第一个瓷砖下方的第二个瓷砖,依此类推
编辑:我希望在组中实现Windows应用商店完成。一件大的,剩下的就包起来。好的。解决了这个问题 步骤1:卸下滚动查看器 步骤2:将网格中第一行的高度设置为某个固定值 步骤3:将网格中第二行的高度设置为* 第4步:去掉文本块上的边距 步骤5:在网格视图上使用填充而不是边距 这将有助于解决其中一些问题