C# items控件项不会在Windows Phone应用程序的ScrollViewer中呈现
我正在尝试在Windows Phone应用程序中创建滚动页面。此页面包含一些静态内容,后面是items控件C# items控件项不会在Windows Phone应用程序的ScrollViewer中呈现,c#,windows-phone,C#,Windows Phone,我正在尝试在Windows Phone应用程序中创建滚动页面。此页面包含一些静态内容,后面是items控件 <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"> <ScrollViewer> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto" /&g
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<ScrollViewer>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock Text="Static text line 1" />
<TextBlock Grid.Row="1" Text="Another lineof static text" />
<ItemsControl Grid.Row="2" ItemsSource="{Binding Path=MyItems}" ItemTemplate="{StaticResource myTemplate}"></ItemsControl>
</Grid>
</ScrollViewer>
</Grid>
奇怪的是,当我使用这种方法时,ItemsControl项不会呈现。但是,如果我将ScrollViewer移动到静态文本项下面,并将ItemsControl放置在ScrollViewer中,则我的项呈现得很好
我做错了什么?我觉得一定有一些我忽略的小而不重要的东西。谢谢。将行
替换为
。*表示它将占用所有可用空间。第一个TextBlock
和ItemsControl
都将位于同一个网格行中,这意味着其中一个将覆盖另一个,但是我认为您无法看到的是TextBlock
。我错过了网格.row定义。现在就到了。不过我同意你的评估。不过,我的物品没有显示出来。