问题描述
大家好,
我推荐了以下论坛
https: //social.msdn.microsoft.com/Forums/en-US/1885dcfa-af48-47ee-85d7-bb9809e24f38/scrollviewerscrolltoverticaloffset-not-working-in-windows-8?forum=winappswithcsharp
https://social.msdn.microsoft.com/Forums/en-US/1885dcfa-af48-47ee-85d7-bb9809e24f38/scrollviewerscrolltoverticaloffset-not-working-in-windows-8?forum=winappswithcsharp
通过调用ScrollViewer.UpdateLayout()方法,我们可以将scrollviewer的位置设置为垂直。我可以看到在使用/不调用ScrollViewer.UpdateLayout()时在UI中更改垂直偏移值。但是,当我尝试从ScrollViewer.VerticalOffset
获取值时,该值不会被更改。
By invoking ScrollViewer.UpdateLayout() method, we can set the position of scrollviewer in vertical. I can see vertical offset value is changed in UI with/without invoking ScrollViewer.UpdateLayout(). But when i try to get the value from ScrollViewer.VerticalOffset which doesn't gets changed.
ScrollViewer.ScrollToVerticalOffset(1905);
// ScrollViewer.UpdateLayout();
// ScrollViewer.UpdateLayout();
更新此ScrollViewer.VerticalOffset的其他任何方式?
Any other way to update this ScrollViewer.VerticalOffset?
推荐答案
请阅读粘性帖子,特别是 发布指南:
主题行标签 &absp; Windows 10 SDK和工具的已知问题  ; 。
Please read the sticky posts, especially the Guide to posting: subject line tags and Known Issues for Windows 10 SDK and Tools .
我们不知道您用于开发通用应用程序的项目是什么类型?是Windows 8.1还是Win10 UWP应用程序? 您能否请
提供最低限度的复制样本?
We have no idea what kind of project you are using for developing Universal App? Is it windows 8.1 or Win10 UWP app? Could you please provide a minimum reproduction sample?
请参阅: ScrollViewer.ScrollToVerticalOffset方法
Please see: ScrollViewer.ScrollToVerticalOffset method
来自docs的注释:" ScrollToVerticalOffset 可能会在Windows 8.1之后更改或不可用于发布版本。而是使用 ChangeView 。"
Note from docs:"ScrollToVerticalOffset may be altered or unavailable for releases after Windows 8.1. Instead, use ChangeView."
这篇关于ScrollViewer的ScrollToVerticalOffset值未在ScrollViewer.VerticalOffset属性中更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!