[UWP]如何在Listview / Gridview中实现平滑滚动?

编程入门 行业动态 更新时间:2024-10-22 11:09:00
本文介绍了[UWP]如何在Listview / Gridview中实现平滑滚动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何在uwp中的Listview / Gridview中实现平滑滚动?即。当我滚动Listview / Gridview时,列表视图列表项不应该在鼠标滚动停止后立即停止,而是应该顺利停止。如何实现这一目标?

How to achieve smooth scroll in Listview/Gridview in uwp? ie. when I scroll Listview/Gridview, the listview listitems should not stop immediately after mouse scroll stops, rather, it should stop smoothly. How toachieve this?

推荐答案

第一件事就是有listview / gridview的默认滚动动画。当您在触摸设备中运行它时,您可以清楚地看到它。

The first thing is that there is default scroll animation for the listview/gridview. When you run it in a touch device you could see it clearly.

如果您需要向列表视图添加平滑滚动效果,您可能需要手动控制ScrollViewer listview的模板。你需要找到它并使用 ScrollViewer.changeView 方法滚动整个内容。你可以参考这个如何做到这一点:如何滚动到UWP中的元素。

If you need to add smooth scrolleffect to the listview, you might need to manually control the ScrollViewer in the listview's template. You need to find it and use the ScrollViewer.changeView method to scroll the whole content. You could refer this like about how to do that:How to scroll to element in UWP.

另一件事是,我不确定滚动功能是否会影响触摸设备中的默认滚动效果。

Another thing is that I'm not sure is that the scroll feature might affect the default scroll effect in a touch device.

祝你好运,

Roy

更多推荐

[UWP]如何在Listview / Gridview中实现平滑滚动?

本文发布于:2023-11-10 16:02:19,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1575822.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:平滑   如何在   UWP   Gridview   Listview

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!