在windows phone中禁用scrollviewer的垂直滚动行为 [英] Disable the vertical scroll-behavior of the scrollviewer in windows phone

查看:56
本文介绍了在windows phone中禁用scrollviewer的垂直滚动行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用滚动查看器来显示一些水平显示的按钮,我可以使用滚动查看器从左到右滚动,反之亦然.但是用户仍然可以向下拖动和滚动,尽管 scrollViewer 会自动滚动回顶部.这提供了一个糟糕的用户体验,因此我想禁用滚动查看器的垂直滚动行为,用户只能水平滚动.有什么想法吗?谢谢.

I am using a scrollviewer to show some buttons displayed horizontally, I can use the scrollviewer to scroll from left to right, and visa versa. But the user can still drag and scroll downward, though the scrollViewer wil scroll back to the top automatically. This provides a bad UX, thus I want to disable the vertical scroll-behavior of the scrollviewer, user can just scroll horizontally. any thoughts? thanks.

<ScrollViewer Grid.Row="2" HorizontalScrollBarVisibility="Hidden" Width="auto" Height="100" Margin="0,12" VerticalAlignment="Bottom">
   <StackPanel Orientation="Horizontal">
                    <Button Height="100" Width="100" Margin="0" Style="{StaticResource ButtonStyle}" Click="Origin_Click">
                    </Button>
<Button Height="100" Width="100" Margin="0" Style="{StaticResource ButtonStyle}" Click="Origin_Click">
                    </Button>
<Button Height="100" Width="100" Margin="0" Style="{StaticResource ButtonStyle}" Click="Origin_Click">
                    </Button>
</StackPanel>    
            </ScrollViewer>

v

推荐答案

使用 VerticalScrollBarVisibility="disabled"

这篇关于在windows phone中禁用scrollviewer的垂直滚动行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆