在 UITableViewController 中摇动 3.0
在阅读了一些关于在 3.0 上实现抖动的帖子后,我想我明白了,但我没有接到任何电话:
motionBegan 动议结束 motionCancelled
这是我读过的一个例子: 如何检测 iPhone 的震动并进行编程
我确信我已经添加了
[self becomeFirstResponder];
和
-(BOOL)canBecomeFirstResponder {
NSLog(@"First responder");
return YES;
}
我应该为这些事件启用特殊代表吗?
我知道这些事件是由系统控制的,它们会传递给第一响应者,然后继续......
有什么想法吗?
谢谢
河
after reading some posts about implementing shaking on 3.0, I think I get the idea but I'm not getting any call to the:
motionBegan
motionEnded
motionCancelled
this is an example of what I've read:
how to detect and program around shakes for the iphone
I'm sure I've added the
[self becomeFirstResponder];
and the
-(BOOL)canBecomeFirstResponder {
NSLog(@"First responder");
return YES;
}
Should I enable a special delegate for those events ?
I understand that those events are controlled by the system, and they are passed to the first responder, and go on ...
any idea ?
thanks,
r.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在让它发挥作用时遇到了很多问题,最后我放弃了并听从了 jandrea 的建议。他建议对 UIWindow 进行子类化并在那里实现 MotionEnded。这是他的帖子这里的引用,看看因为它还很远。
I had loads of problems getting this to work and I finally gave up and followed jandrea's advice. He suggested subclassing UIWindow and implement the motionEnded there. This is a quote from his post here, look for it quite far down.
您在哪里调用
becomeFirstResponder
?您应该在viewDidAppear
中执行此操作。这会被解雇吗?Where do you call
becomeFirstResponder
? You should do it inviewDidAppear
. Does this get fired?