Windows phone 8 如何检查用户是否已滚动到ListView中项目的末尾
有没有办法知道用户是否已滚动到ListView中项目的末尾。我正在Windows Phone 8.1中开发此链接,它将帮助您如果您使用的是winjs,您可以使用该代码Windows phone 8 如何检查用户是否已滚动到ListView中项目的末尾,windows-phone-8,windows-phone-8.1,Windows Phone 8,Windows Phone 8.1,有没有办法知道用户是否已滚动到ListView中项目的末尾。我正在Windows Phone 8.1中开发此链接,它将帮助您如果您使用的是winjs,您可以使用该代码 var self = this; document.querySelector(".win-vertical").onscroll = function () { if (self.endOfScroll(this) === true) { //do your stuff } }; endOfSc
var self = this;
document.querySelector(".win-vertical").onscroll = function () {
if (self.endOfScroll(this) === true) {
//do your stuff
}
};
endOfScroll: function (element) {
return element.scrollHeight - element.scrollTop === element.clientHeight
},
我使用win vertical作为“非轴”页面
如果使用透视,可以通过“.win pivot item content”更改透视
在c中#
公共静态ScrollViewer GetScrollViewer(DependencyObject depObj)
{
如果(depObj是ScrollViewer),则返回depObj作为ScrollViewer;
for(int i=0;ipublic static ScrollViewer GetScrollViewer(DependencyObject depObj)
{
if (depObj is ScrollViewer) return depObj as ScrollViewer;
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(depObj); i++)
{
var child = VisualTreeHelper.GetChild(depObj, i);
var result = GetScrollViewer(child);
if (result != null) return result;
}
return null;
}
// subscription:
GetScrollViewer(yourListView).ViewChanged += yourEvent_ViewChanged;