Windows 8 Metro style ListView auto scroll

依然范特西╮ 提交于 2019-12-14 04:26:11

问题


I am using a ListView in a Windows 8 Metro style app and I want to programatically make it scroll to a point where a particular item is in the view.

Is this possible?


回答1:


Not sure if you're working with JavaScript or XAML, but in JavaScript you should be able to just set the ensureVisible(index) property of the ListView. This will make sure that item is visible, scrolling the ListView if necessary:

  • http://msdn.microsoft.com/en-us/library/windows/apps/br211820.aspx

In XAML, the ScrollIntoView(object) should be what you need. (For SemanticZoom, see MakeVisible.)

  • http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.listviewbase.scrollintoview.aspx


来源:https://stackoverflow.com/questions/12038022/windows-8-metro-style-listview-auto-scroll

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!