我有一个WP8 Pivot应用程序并尝试在ProgressBar
中插入TextBlock
和Pivot Item
,但它似乎没有显示。
<phone:PivotItem Header="Tweets">
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<Grid.Resources>
<DataTemplate x:Key="tweetlist">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!-- I would like to have the Progress bar here -->
<!-- I would like to have the textblock here -->
<Rectangle Fill="Aqua" Height="50" Width="50" Grid.Row="0" Grid.Column="0"
VerticalAlignment="Top" Margin="0,7,7,0"
Grid.RowSpan="2">
</Rectangle>
<Image Height="50" Width="50" Grid.Row="0" Grid.Column="0"
VerticalAlignment="Top" Margin="0,7,7,0"
Grid.RowSpan="2" Source="{Binding Image}">
</Image>
<TextBlock Text="{Binding DateOfTweet}" Grid.Row="0" Grid.Column="1"
Foreground="{StaticResource PhoneAccentBrush}" VerticalAlignment="Top" />
<TextBlock Text="{Binding Tweet}" TextWrapping="Wrap" Foreground="Black"
Grid.Row="1" Grid.Column="1"
VerticalAlignment="Top" />
</Grid>
</DataTemplate>
</Grid.Resources>
<!-- <TextBlock Text="Tweet List" Foreground="Black" FontSize="26" HorizontalAlignment="Center" Margin="10" />-->
<ListBox
ScrollViewer.VerticalScrollBarVisibility="Visible"
ItemTemplate="{StaticResource tweetlist}"
x:Name="llsTweets" ItemsSource="{Binding Tweets}">
</ListBox>
</Grid>
</phone:PivotItem>
我是如何实现这一目标的?
答案 0 :(得分:0)
这是一个重叠问题。不要在网格的单元格中放置多个控件,如果不需要,请不要使用Grid.RowSpan
。
使用stackpanel
或子网格将单元格分解为更小的部分。