gpt4 book ai didi

windows - WP7 Horizo​​ntal ListBox 末尾的项目被切断

转载 作者:可可西里 更新时间:2023-11-01 10:49:32 26 4
gpt4 key购买 nike

我遇到了一个令人沮丧的问题,我的列表框中的最后几个项目被截断了。

我已将我的列表框设置为水平滚动和显示。我的 ItemPanelTemplate 包含一个 VirtualizedStackPanel(当我使用普通的堆栈面板时,我的列表框只显示有限数量的项目,而虚拟的显示除了最后两个之外的所有项目)

我必须指出,当我将其从水平更改为垂直时,一切正常,这是我的 xaml。

请帮忙

<Grid Name="JumpTo" Visibility="Collapsed" Background="#FF0A0909" Opacity="0.95" >
<TextBlock Text="Jump To"/>
<ListBox ItemsSource="{Binding}"
HorizontalAlignment="Left"
Name="lbJumpTo"
VerticalAlignment="Top"
SelectionChanged="lbJumpTo_SelectionChanged"
Height="248" Width="623"
Margin="34,77,0,0" ScrollViewer.HorizontalScrollBarVisibility="Auto">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Horizontal"></VirtualizingStackPanel>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>

<ListBox.ItemTemplate>
<DataTemplate>

<StackPanel Orientation="Vertical" Width="200" Height="160">

<Grid x:Name="gridLoop" Height="90" Width="150" Background="{x:Null}">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>

<Image Source="{Binding LoopDisplayMatrix[0][0]}" Grid.Row="0" Grid.Column="0" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[0][1]}" Grid.Row="0" Grid.Column="1" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[0][2]}" Grid.Row="0" Grid.Column="2" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[0][3]}" Grid.Row="0" Grid.Column="3" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[0][4]}" Grid.Row="0" Grid.Column="4" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[0][5]}" Grid.Row="0" Grid.Column="5" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[0][6]}" Grid.Row="0" Grid.Column="6" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[0][7]}" Grid.Row="0" Grid.Column="7" Width="20" Height="20"/>

<Image Source="{Binding LoopDisplayMatrix[1][0]}" Grid.Row="1" Grid.Column="0" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[1][1]}" Grid.Row="1" Grid.Column="1" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[1][2]}" Grid.Row="1" Grid.Column="2" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[1][3]}" Grid.Row="1" Grid.Column="3" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[1][4]}" Grid.Row="1" Grid.Column="4" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[1][5]}" Grid.Row="1" Grid.Column="5" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[1][6]}" Grid.Row="1" Grid.Column="6" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[1][7]}" Grid.Row="1" Grid.Column="7" Width="20" Height="20"/>

<Image Source="{Binding LoopDisplayMatrix[2][0]}" Grid.Row="2" Grid.Column="0" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[2][1]}" Grid.Row="2" Grid.Column="1" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[2][2]}" Grid.Row="2" Grid.Column="2" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[2][3]}" Grid.Row="2" Grid.Column="3" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[2][4]}" Grid.Row="2" Grid.Column="4" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[2][5]}" Grid.Row="2" Grid.Column="5" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[2][6]}" Grid.Row="2" Grid.Column="6" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[2][7]}" Grid.Row="2" Grid.Column="7" Width="20" Height="20"/>

<Image Source="{Binding LoopDisplayMatrix[3][0]}" Grid.Row="3" Grid.Column="0" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[3][1]}" Grid.Row="3" Grid.Column="1" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[3][2]}" Grid.Row="3" Grid.Column="2" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[3][3]}" Grid.Row="3" Grid.Column="3" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[3][4]}" Grid.Row="3" Grid.Column="4" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[3][5]}" Grid.Row="3" Grid.Column="5" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[3][6]}" Grid.Row="3" Grid.Column="6" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[3][7]}" Grid.Row="3" Grid.Column="7" Width="20" Height="20"/>

<Image Source="{Binding LoopDisplayMatrix[4][0]}" Grid.Row="4" Grid.Column="0" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[4][1]}" Grid.Row="4" Grid.Column="1" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[4][2]}" Grid.Row="4" Grid.Column="2" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[4][3]}" Grid.Row="4" Grid.Column="3" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[4][4]}" Grid.Row="4" Grid.Column="4" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[4][5]}" Grid.Row="4" Grid.Column="5" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[4][6]}" Grid.Row="4" Grid.Column="6" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[4][7]}" Grid.Row="4" Grid.Column="7" Width="20" Height="20"/>

<Image Source="{Binding LoopDisplayMatrix[5][0]}" Grid.Row="5" Grid.Column="0" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[5][1]}" Grid.Row="5" Grid.Column="1" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[5][2]}" Grid.Row="5" Grid.Column="2" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[5][3]}" Grid.Row="5" Grid.Column="3" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[5][4]}" Grid.Row="5" Grid.Column="4" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[5][5]}" Grid.Row="5" Grid.Column="5" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[5][6]}" Grid.Row="5" Grid.Column="6" Width="20" Height="20"/>
<Image Source="{Binding LoopDisplayMatrix[5][7]}" Grid.Row="5" Grid.Column="7" Width="20" Height="20"/>

</Grid>

<StackPanel Orientation="Vertical" Height="50" Width="100">
<TextBlock Text="{Binding LoopName}" Width="150" Height="40" />
<TextBlock Text="{Binding TempoDisplay}" Width="150" Height="40" />
</StackPanel>

</StackPanel>

</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>

最佳答案

干杯 Senthil Kumar。我将数据模板中 Top Stackpanel 的宽度设置为自动,这解决了我的问题。

关于windows - WP7 Horizo​​ntal ListBox 末尾的项目被切断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10428098/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com