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

可以设置最小值吗? #13

Open
imhappyok opened this issue Oct 16, 2024 · 8 comments
Open

可以设置最小值吗? #13

imhappyok opened this issue Oct 16, 2024 · 8 comments

Comments

@imhappyok
Copy link

现在需求滑动范围是20-50,库默认是0-100,可以修改最大为50,但是没看到可以设置最小值

@jenly1314
Copy link
Owner

现在需求滑动范围是20-50,库默认是0-100,可以修改最大为50,但是没看到可以设置最小值

这个我有空的时候加一下,你可以先自己简单换算下;
max = rawMax - rawMin
rawProgress = progress + rawMin

@imhappyok
Copy link
Author

imhappyok commented Oct 16, 2024 via email

@jenly1314
Copy link
Owner

max = rawMax - rawMin
rawProgress = progress + rawMin

我怎么改变步进,距离为我想要20到50,但是每次滑动是以0.5为进度的,我看当前好像是1

---- 回复的原邮件 ---- | 发件人 | @.> | | 日期 | 2024年10月16日 16:55 | | 收件人 | @.> | | 抄送至 | @.>@.> | | 主题 | Re: [jenly1314/ArcSeekBar] 可以设置最小值吗? (Issue #13) | 现在需求滑动范围是20-50,库默认是0-100,可以修改最大为50,但是没看到可以设置最小值 这个我有空的时候加一下,你可以先自己简单换算下; max = rawMax - rawMin rawProgress = progress + rawMin — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

还是一样,假设步进为:step,代入进行换算;

max = (rawMax - rawMin) / step
rawProgress = progress * step + rawMin

@imhappyok
Copy link
Author

还有个问题,当我设置最小值0,最大值3,发现拉动不了,最大值是4就可以,不知道是不是有什么限制住了

@jenly1314
Copy link
Owner

还有个问题,当我设置最小值0,最大值3,发现拉动不了,最大值是4就可以,不知道是不是有什么限制住了

限制原因:防止滑动突变

@imhappyok
Copy link
Author

可以添加属性,让我可以设置去掉这个限制吗,不然有可能出现这种情况,别人就提bug了

@jenly1314
Copy link
Owner

可以添加属性,让我可以设置去掉这个限制吗,不然有可能出现这种情况,别人就提bug了

加限制的初衷就是防止滑动突变,只是有这个限制可能不满足你的需求场景;等有空时再改,急的话你也可以自己改。

@imhappyok
Copy link
Author

imhappyok commented Oct 17, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants