MotionEnded 未被连续调用
主视图中有一个视频列表。在该主视图中,我添加了一个 UIWebView 作为子视图来播放视频。
我想这样做,当我摇动 iPhone 时,它应该在 UIWebView 中播放下一个视频。
它第一次工作正常,但当回到主视图并再次尝试执行相同的操作时,它没有反应。
请问有什么解决办法吗?
There is a list of videos in main view. In that main view, i have added a UIWebView as subview to play videos.
I suppose to do, when i shake iPhone it should play the next video in UIWebView.
It is working fine for the very first time but as come back to main view and again try to perform the same thing, it is not reacting.
Any solution please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保当视图(重新)出现时,您将其设置为第一响应者。
它需要位于 viewDidAppear 而不是 viewWillAppear 中
Make sure when the view (re)appears that you set it as the first responder.
It needs to be in viewDidAppear and not viewWillAppear