Windows Phone 上的 WP7 ScrollViewer Snap-Back 和自动滚动条可见性问题
我有一个应用程序,它在 ScrollViewer 中显示包装文本,该文本占据页面的固定高度。我将 HorizontalScrollBarVisibility 设置为“禁用”,将 VerticalScrollBarVisibility 设置为“自动”。
我遇到的可用性问题如下: 尽管设置为“自动”,但如果内容小于 ScrollViewer,则内容仍然可以上下滚动,要么滚动到末尾,要么隐藏部分文本。我希望 ScrollViewer 在整个内容适合其边界时不允许滚动。至少,当您过度滚动时,它应该始终将内容重新拉回到视图中。
其次,当内容滚动时,它有时会卡在末尾,并且不会从过度滚动中“弹回”。例如,如果内容完全适合 ScrollViewer,并且您在文本上向上或向下拖动手指,则文本将被 ScrollViewer 的顶部或底部遮挡,并且不会弹回。但是,如果您从 ScrollViewer 内容的外部开始向上拖动手指,则当您滚动超过任一端时,它会弹回。我希望无论您拖动到内容上还是内容之外,都会发生“快速返回”行为。这可能吗?
I have an application that displays wrapped text in a ScrollViewer that takes up a fixed height of the page. I set the HorizontalScrollBarVisibility to Disabled, and the VerticalScrollBarVisibility to Auto.
The usability problems I'm having are as follows:
Despite being set to Auto, if the content is smaller than the ScrollViewer, then the content can still scroll up and down, either scrolling past the end or hiding a portion of the text. I would like the ScrollViewer not to allow scrolling when the entire content fits inside its bounds. At the very least it should always snap the content back into view when you over-scroll.
Secondly, when the content does scroll, it sometimes gets stuck past the end and won't "snap back" from the over-scroll. For example, if the content fits fully in the ScrollViewer, and you drag your finger up or down on the text, the text will be obscured by the top or bottom of the ScrollViewer, and won't snap back. If however you drag your finger up starting from outside of the content of the ScrollViewer, it will snap back when you scroll past either end. I would like the "snap back" behavior to happen whether you drag on the content or outside of the content. Is that possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
第一个问题:如果您的内容不够大,不足以保证需要滚动查看器,请不要将其放入滚动查看器中。如果内容的大小发生变化,则仅在内容量允许时才启用滚动条。
您能提供一种重现第二个问题的方法吗?
First issue: If your content isn't large enough to warrant the need for a scroll viewer don't put it in one. If the size of the content changes only enable the scrollbar when the volume of content warrants it.
Can you provide a way of reproducing the second issue.