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

关于 UITableViewCell 取消点击的问题,比较影响用户的取消操作 #25

Closed
ymsmile opened this issue Sep 11, 2016 · 5 comments

Comments

@ymsmile
Copy link

ymsmile commented Sep 11, 2016

感谢作者提供的开源控件。thx

前提:当手指在按住 cell 的时候,cell 会进入 highlighted 状态;此时松开手指的话,则会响应 UITableView 的 delegate 的点击事件;但是如果手指稍微滑动一下再松开手指,则不会响应 UITableView 的 delegate 的点击事件,这是比较友好的一个细节,提供用户取消选择的机会。

因为禁止了 UITableView 的滑动事件,所以如果选择了其中某一行,则没办法取消选择了。不知道有什么办法解决没?

@iTofu
Copy link
Owner

iTofu commented Sep 12, 2016

我也注意到了这个问题,的确是一个影响体验的地方。我也想了想解决方案,觉得比较可行的方案是:监听 UIScrollViewDelegate 方法,然后手动实现不滚动的效果。。。但是我觉得这个实现的好诡异,所以就没加上去,不知道你有什么更好的建议或方法吗?

@ymsmile
Copy link
Author

ymsmile commented Sep 12, 2016

昨晚重写了 cell 的 touch 事件,利用点击的 point 是否在 cell 的范围内来设置 cell 的高亮状态,状态可以改变,但是却无法响 应 UITableView 的点击事件了,估计是冲突了吧。也没想出其他方法。

@iTofu
Copy link
Owner

iTofu commented Sep 12, 2016

嗯…… 再看看吧,如果有更多人提这个问题的话,再尝试想想其他方法。如果没有更好的,可能就把那个诡异的处理方案上上去……

iTofu pushed a commit that referenced this issue Sep 23, 2016
@iTofu
Copy link
Owner

iTofu commented Sep 23, 2016

用 UIScrollViewDelegate 方法做了实现,不过 CocoaPods 貌似出了点问题,正式版不支持 Xcode 8?等问题没有了才能推到 CocoaPods Repo,目前可以使用如下方式导入:

pod 'LCActionSheet', :git => 'https://github.com/iTofu/LCActionSheet.git'

@ymsmile
Copy link
Author

ymsmile commented Sep 23, 2016

👍👍👍

Xcode 8 暂时没有用,怕影响进度。

@ymsmile ymsmile closed this as completed Sep 23, 2016
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