简体   繁体   中英

How can I scroll to bottom of ListView in Windows Phone 8.1 RT App?

  1. I have tried ScrollIntoView() but that doesn't work because the item may or may not be in viewport.

  2. I tried WinRTXAMLToolkit (VisualTreeHelper class):

    var scrollViewer = listView.GetFirstDescendantOfType(); scrollViewer.ChangeView(null, scrollViewer.ScrollableHeight, null);

It doesn't scroll to bottom every time, and when it does not, it scrolls to slightly above (from bottom).

ListView.ScrollIntoView(ListView.Items[ListView.Items.Count - 1] as YourModel, ScrollIntoViewAlignment.Leading);

仅当您在Viewport显示后没有图像或任何其他元素时,此选项才有效。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM