XAML水平Stackpanel滚动
发布时间:2020-12-14 02:03:50 所属栏目:Windows 来源:网络整理
导读:我在滚动浏览器中滚动水平堆栈面板时遇到问题.我正在尝试做的比我的例子更复杂,但在删除变量之后,我想如果我能解决这个问题,我可以解决所有问题. 基本上,当包含水平堆栈面板时,我无法让滚动查看器水平滚动. 以下是XAML示例: ScrollViewer StackPanel Orient
我在滚动浏览器中滚动水平堆栈面板时遇到问题.我正在尝试做的比我的例子更复杂,但在删除变量之后,我想如果我能解决这个问题,我可以解决所有问题.
基本上,当包含水平堆栈面板时,我无法让滚动查看器水平滚动. 以下是XAML示例: <ScrollViewer> <StackPanel Orientation="Horizontal"> <Image Source="test.png" Width="400" Height="400"/> <Image Source="test.png" Width="400" Height="400"/> <Image Source="test.png" Width="400" Height="400"/> <Image Source="test.png" Width="400" Height="400"/> <Image Source="test.png" Width="400" Height="400"/> <Image Source="test.png" Width="400" Height="400"/> <Image Source="test.png" Width="400" Height="400"/> </StackPanel> </ScrollViewer> 奇怪的是,如果我只是将方向从水平交换到垂直,它滚动就好了.我已经阅读过多个帖子,堆栈面板有问题可能使它们不适合滚动查看器,所以我也尝试使用网格,但得到相同的结果. <ScrollViewer> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="400"/> <ColumnDefinition Width="400"/> <ColumnDefinition Width="400"/> <ColumnDefinition Width="400"/> <ColumnDefinition Width="400"/> <ColumnDefinition Width="400"/> </Grid.ColumnDefinitions> <Image Source="test.png" Width="400" Height="400" Grid.Column="0"/> <Image Source="test.png" Width="400" Height="400" Grid.Column="1"/> <Image Source="test.png" Width="400" Height="400" Grid.Column="2"/> <Image Source="test.png" Width="400" Height="400" Grid.Column="3"/> <Image Source="test.png" Width="400" Height="400" Grid.Column="4"/> <Image Source="test.png" Width="400" Height="400" Grid.Column="5"/> </Grid> </ScrollViewer> 看起来很简单,我觉得我误解了一些基本的东西.如果有人可以提供帮助,我将非常感激. 解决方法
你只需要打开水平滚动.
It’s hidden by default(但垂直的不是,因此混乱).
<ScrollViewer HorizontalScrollBarVisibility="Auto"> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- windows-server-2003 – IIS6,Windows 2003 Server上的Ioni
- 如何在没有cygwin的Windows上以分布式模式运行HBase?
- 实时监控MS Windows服务器及其服务
- Windows之间的jQuery / javascript通信?
- windows – 匿名,身份验证,模拟和委托有什么区别,为什么委托
- .net – 以编程方式更新Windows 8开发者许可证?
- Microsoft SQL Server备份physical_device_name
- .net – 您是否在GAC中安装域DLL?
- windows – node.js和命令行(cmd.exe)
- Windows Azure辅助角色实例是整个VM吗?