简体   繁体   English

如何找出一个人何时将手指离开屏幕?

[英]how to find out when a person has left his finger off the screen?

thats pretty much all i was wondering. 多数民众赞成在我想知道的一切。 Anybody have a quick answer? 有人快速回答吗?

i want my program to do some code when the user stops scrolling and has lifted his finger up 我希望我的程序在用户停止滚动并抬起手指时执行一些代码

you can implement the following method: 您可以实现以下方法:

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event

This will get called whenever you are lifting your finger up. 每当您抬起手指时,都会调用此方法。

if you use scrollView , it is better use the delegate: 如果使用scrollView,则最好使用委托:

// called on finger up if the user dragged. decelerate is true if it will continue moving afterwards
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM