UISlider 右端未接收到触摸
我的主视图中有一个 UISlider,但它在右端没有接收到触摸。我以为这可能是一个令人讨厌的视图覆盖它,但它绝对不是。还有人有其他想法吗?
I've got a UISlider in my main view, but it doesn't receive touches at the right end. I thought it could be a pesky view covering it, but it definitely isn't. Has anyone got any other ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我猜你的
UISlider
超出了超级视图的范围。尝试将UISlider
超级视图的背景设置为某种颜色并检查一下。I guess your
UISlider
fell out of bounds of the superview. Try to set background ofUISlider
superview to some color and check it out.它在你的控制中设置UISlider的高度和宽度,使用CGRectMake...并且它的触摸敏感直到给定的宽度..我想你会错过写下面的选项...
试试看..它已经工作了为我。
Its in your control to set the height and width of UISlider, using CGRectMake... and its touch sensitive till the given width.. i think u would have missed writing the below option...
Just try it out.. it had worked for me.
我发现就我而言,当 UISlider 的右/左边框与其父视图的相应边框匹配时,就会出现问题。使超级视图更宽,以便它们的边界之间有 5.0-10.0 的距离,这为我解决了这个问题。
I found out that in my case, the issue occurred when the right/left border of the UISlider matched its superview's corresponding border. Making the superview wider so that there would be 5.0-10.0 distance between their borders solved the issue for me.