[UWP] [VB] [XAML]使用始终可见的垂直ScrollBar创建ScrollViewer [英] [UWP][VB][XAML]Creating a ScrollViewer with a vertical ScrollBar that is always visible

查看:99
本文介绍了[UWP] [VB] [XAML]使用始终可见的垂直ScrollBar创建ScrollViewer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ItemsControl,我需要把它放在ScrollViewer中。这不是问题,但我希望垂直ScrollBar始终可见即使我有VerticalScrollMode =" Auto"和VerticalScrollBarVisibility ="可见"它是
只有在将鼠标移到它上面时才能看到并且需要滚动。我希望它始终可见,原因有几个。首先,它将帮助人们知道该区域为空时的区域(而不是仅仅看到黑色矩形)。其次,
帮助人们意识到他们可以向下滚动查看更多项目。第三,它使得项目的样式和大小变得更容易,因为如果我没有添加额外的边距(当隐藏ScrollBar的
时看起来很难看),ScrollBar会部分地覆盖项目。如何阻止ScrollBar消失?创造&修改额外的模板看起来像是很多额外的工作,并且像VerticalScrollBarVisibility这样的属性我认为会有更简单的方法。有任何想法吗?谢谢!



Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/

解决方案

< blockquote>

Hello Nathan,


以下SO线程似乎提供了一个好主意:


http://stackoverflow.com/questions / 25058049 / making-scrollviewers-scrollbar-always-visible-through-over -iding-or-styling


   VisualState" NoIndicator"列出两个动画,使滚动条不可见。我们可能会尝试编辑它以使动画不起作用。


有关详细信息,我们可以看到默认
模板
。顺便说一下,对于UI问题,我们认为推荐的方式是先在XAML中处理。 


祝你好运,


Barry



I have an ItemsControl which I need to put in a ScrollViewer. This is not a problem, but I want the vertical ScrollBar to be always visible Even though I have VerticalScrollMode="Auto" and VerticalScrollBarVisibility="Visible" it is only visible when moving the mouse over it and scrolling is necessary. I want it to be always visible for several reasons. First of all, it will help people know what that area is for when it is empty (instead of just seeing a black rectangle). Second, it helps people realize that there are more items that they can scroll down to see. Third, it makes it easier to style and size the items, since the ScrollBar partially covers the items when it is visible if I don't add an extra margin (which looks ugly when the ScrollBar is hidden). How can I stop the ScrollBar from disappearing? Creating & modifying extra templates seems like a lot of extra work, and with properties like VerticalScrollBarVisibility I would think there would be an easier way. Any ideas? Thanks!


Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/

解决方案

Hello Nathan,

It seems the following SO thread provides a good idea:

http://stackoverflow.com/questions/25058049/making-scrollviewers-scrollbar-always-visible-through-overriding-or-styling

The VisualState "NoIndicator" list two animation which makes the scrollbar un-visible. We may try edit it to make the animation not works.

For details we can see the default template here. By the way, for UI issue, the recommend way we think is to handle in XAML first. 

Best regards,

Barry


这篇关于[UWP] [VB] [XAML]使用始终可见的垂直ScrollBar创建ScrollViewer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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