Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slider 触摸操作 #51

Open
STBBRD opened this issue Apr 2, 2024 · 5 comments
Open

Slider 触摸操作 #51

STBBRD opened this issue Apr 2, 2024 · 5 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@STBBRD
Copy link

STBBRD commented Apr 2, 2024

为 Slider 添加正常的触摸操作

  • 触摸拖动时让小球跟随手指移动,而不是仅在松手时移动
  • 触摸点击时让小球跑到点击的位置,而不是朝点击的位置移动一点点
@NotYoojun NotYoojun added bug Something isn't working help wanted Extra attention is needed labels Apr 2, 2024
@NotYoojun
Copy link
Member

test-4uehd3h9.zip

触摸拖动时让小球跟随手指移动

为什么我这里的slider可以正常触摸滑动,
看看上面这个程序里的 Slider 可以滑动不

image

触摸点击时让小球跑到点击的位置

貌似是wpf默认的设定,不知道能不能改
我试了一下,winui的slider是你说的那样

image

这玩意是左右各一个RepeatButton,但是这个按钮貌似是使用了Command接收事件,而不是Click,这就会使自定义有点麻烦

image

@NotYoojun
Copy link
Member

我加了 Tick,但是还是没法复现你说的那个问题。
试试 Test-347ry2d84hu.zip

我在想会不会是你在 Slider 的外面套了 ScrollViewer 或者 ui:ScrollViewerEx?

@NotYoojun NotYoojun added the question Further information is requested label Apr 8, 2024
@STBBRD
Copy link
Author

STBBRD commented Apr 13, 2024

那确实

我加了 Tick,但是还是没法复现你说的那个问题。 试试 Test-347ry2d84hu.zip

我在想会不会是你在 Slider 的外面套了 ScrollViewer 或者 ui:ScrollViewerEx?

@STBBRD
Copy link
Author

STBBRD commented Apr 13, 2024

那确实

我加了 Tick,但是还是没法复现你说的那个问题。 试试 Test-347ry2d84hu.zip
我在想会不会是你在 Slider 的外面套了 ScrollViewer 或者 ui:ScrollViewerEx?

ScrollViewer PanningMode="VerticalOnly"

@NotYoojun
Copy link
Member

那确实

我加了 Tick,但是还是没法复现你说的那个问题。 试试 Test-347ry2d84hu.zip
我在想会不会是你在 Slider 的外面套了 ScrollViewer 或者 ui:ScrollViewerEx?

ScrollViewer PanningMode="VerticalOnly"

这个办法也可以,要不我回去改改 ScrollViewer.PanningMode的逻辑,看能不能解决这个问题。
主要是 ScrollViewer 和 Slider 的触摸逻辑有冲突。

@NotYoojun NotYoojun removed the question Further information is requested label Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants