我的 metro-app 中有一个 ListView 。我想在我的 ListView 中设置最后一项的焦点?如何设置 ListView 项的焦点?有人可以帮助我吗?
谢谢。
最佳答案
您需要使用 ListViews currentItem
属性:
http://msdn.microsoft.com/en-us/library/windows/apps/hh700672.aspx
具体来说,为它分配一个对象,其中包含您要选择的数据项的索引(来自您的数据源),以及 hasFocus
和 showFocus
属性集:
var yourListView = getYourListViewFromSomewhere();
yourListView.currentItem = { index: 8, hasFocus: true, showFocus: true }
关于javascript - 如何在 Metro 应用程序中设置 Listview 项目的焦点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13684678/