到达 ScrollViewer 底部 - 最大 VerticalOffset 值低于 ScrollableHeight [英] Reaching bottom of ScrollViewer - maximum VerticalOffset value is lower than ScrollableHeight

查看:54
本文介绍了到达 ScrollViewer 底部 - 最大 VerticalOffset 值低于 ScrollableHeight的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在检测用户何时到达 ScrollViewer 底部时遇到问题.

I have problem with detecting when user reached the bottom of a ScrollViewer.

我的代码:

bool atBottom = scrollViewer.VerticalOffset >= scrollViewer.ScrollableHeight;

但有时当我到达Scrollviewer的底部时,scrollViewer.VerticalOffset的值低于scrollViewer.ScrollableHeight.这取决于列表框中的项目,但我不知道如何.

But sometimes when I reached the bottom of Scrollviewer, value of scrollViewer.VerticalOffset is lower than scrollViewer.ScrollableHeight. It depends on items in listbox, but I dont know how.

你知道问题出在哪里吗?

Do you know, where is the problem?

推荐答案

您不应该使用这种方法来检测到达滚动查看器的底部.相反,您应该使用 Scroll 状态来检测这一点.

You shouldn't use this approach to detect reaching the bottom of the scrollviewer. Instead you should use the Scroll states to detect this.

http://blogs.msdn.com/b/slmperf/archive/2011/06/30/windows-phone-mango-change-listbox-how-to-detect-compression-end-of-scroll-states.aspx

这篇关于到达 ScrollViewer 底部 - 最大 VerticalOffset 值低于 ScrollableHeight的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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