Windows 8的Metro风格的ListView自动滚屏 [英] Windows 8 Metro style ListView auto scroll
问题描述
我在Windows 8 Metro风格应用程序使用的ListView
,我希望通过编程使其滚动到一个点,一个特定的产品视图。
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.
这可能吗?
推荐答案
不知道,如果你与JavaScript或XAML的工作,但在JavaScript中,你应该能够只需设置 ensureVisible(指数)
ListView控件的属性。这将确保该项目是可见的,滚动的ListView控件在必要时:
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
在XAML中, ScrollIntoView(对象)
应该是你所需要的。 (对于SemanticZoom,请参阅 MakeVisible
)
In XAML, the ScrollIntoView(object)
should be what you need. (For SemanticZoom, see MakeVisible
.)
这篇关于Windows 8的Metro风格的ListView自动滚屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!