.net – ScrollViewer中的ListBox
发布时间:2020-12-14 05:46:24 所属栏目:Windows 来源:网络整理
导读:我不知道为什么这段代码工作正常: ScrollViewer Height="674" HorizontalAlignment="Left" VerticalAlignment="Top" Width="480" Margin="0,94,0" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" StackPanel Button Content
我不知道为什么这段代码工作正常:
<ScrollViewer Height="674" HorizontalAlignment="Left" VerticalAlignment="Top" Width="480" Margin="0,94,0" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"> <StackPanel> <Button Content="custom control" VerticalAlignment="Center" Width="480" Height="70" /> <Button Content="custom control" VerticalAlignment="Center" Width="480" Height="70" /> <Button Content="custom control" VerticalAlignment="Center" Width="480" Height="70" /> <Button Content="custom control" VerticalAlignment="Center" Width="480" Height="70" /> <Button Content="custom control" VerticalAlignment="Center" Width="480" Height="70" /> <Button Content="custom control" VerticalAlignment="Center" Width="480" Height="70" /> <Button Content="custom control" VerticalAlignment="Center" Width="480" Height="70" /> <Button Content="custom control" VerticalAlignment="Center" Width="480" Height="70" /> <Button Content="custom control" VerticalAlignment="Center" Width="480" Height="70" /> <Button Content="custom control" VerticalAlignment="Center" Width="480" Height="70" /> <Button Content="custom control" VerticalAlignment="Center" Width="480" Height="70" /> <Button Content="custom control" VerticalAlignment="Center" Width="480" Height="70" /> <Button Content="custom control" VerticalAlignment="Center" Width="480" Height="70" /> <Button Content="custom control" VerticalAlignment="Center" Width="480" Height="70" /> <Button Content="custom control" VerticalAlignment="Center" Width="480" Height="70" /> </StackPanel> </ScrollViewer> 这不是: <ScrollViewer Height="674" HorizontalAlignment="Left" VerticalAlignment="Top" Width="480" Margin="0,0" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"> <ListBox Width="480" ItemsSource="{Binding ViewModel_ObservableCollection_Property_With_15_Items}"> <ListBox.ItemTemplate> <DataTemplate> <Grid Height="85"> <Button Content="custom control" VerticalAlignment="Center" Width="480" Height="70" /> </Grid> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </ScrollViewer> ListBox版本无法显示ScrollViewer中的所有项目.诀窍是什么? 解决方法
您应该避免使用ScrollViewer来包装ListBox,因为在默认的ListBox样式中已经存在ScrollViewer.
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- windows-server-2008-r2 -svchost.exe -k netsvcs占用> 1GB
- Windows Phone 8 – 隐藏使用jQuery Mobile的Phonegap App中
- windows-server-2003 – IIS 6.0上的HTTP压缩(Windows Serv
- windows-server-2008 – 在Windows Server 2008 SP2上启用T
- windows-server-2008 – 如何整合来自不同服务器的所有事件
- windows-8 – 在Windows 8应用程序中为DispatcherTimer的Ti
- win10下安装mathtype出现“无法加载此加载程序 MathPage.wl
- 我们如何在Windows上清除Iex中的屏幕
- Microsoft Teams Voice语音落地系列-5 实战: Sonus语音网关
- windows-server-2003 – 如何确定MSMQ 3.0容量和服务器规格