实现自定义ScrollViewer的最佳方法是什么? [英] What's the best way to implement a custom ScrollViewer?

查看:57
本文介绍了实现自定义ScrollViewer的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的目标:

创建一个水平滚动视图,其中包含 x 面板,每个屏幕宽度约为1/3。视图将以这样一种方式捕捉到面板,即一个总是精确地居中在屏幕上(除非在滚动的中间)。 2个非中心视图将
将所有元素的不透明度减少一些因素。

Create a horizontally scrolling view that holds x panels, each ~1/3 screen width. The view will snap to the panels in such a way that one is always exactly centered on screen (except when in the middle of a scroll). The 2 non-central views will have all element's Opacity cut by some factor.

我的第一个想法是扩展ScrollViewer,但我发现它是一个密封的类。我会考虑使用GridView,但我认为除了
ScrollIntoView() 方法,但这让我无法控制屏幕上元素的位置(对齐参数只有2个选项,屏幕的默认和前导
边缘)。

My first thought was to extend ScrollViewer, but I see that it is a sealed class. I would consider using a GridView, but I see no way to programatically scroll it other than the ScrollIntoView() method, but that gives me no control over where on the screen it positions the element (the alignment parameter only has 2 options, the default and leading edge of the screen).

我应该在哪里寻找完成此任务的线索?谢谢:)

Any clues on where I should look to accomplish this? Thanks :)

推荐答案

以及使用滚动查看器制作自己的自定义控件怎么样?
and what about making a own custom control with a scrollviewer in it?


这篇关于实现自定义ScrollViewer的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆