iPhone如何以编程方式处理SMS /呼叫警报通知 [英] iPhone How to programmatically handle SMS/Call alert notification
问题描述
我在SMS警报和呼叫通知方面遇到了一些问题,冻结了视频播放器。我当前正在使用带有movieControl Hidden的MPMoviePlayerController显示视频。我还将在视频上方使用UITextView覆盖字幕。
I'm having some problems with SMS alerts and call notification freezing up the video player. I'm currently displaying a video using MPMoviePlayerController with movieControl Hidden. I'm also overlaying a subtitle using UITextView on top of the video.
但是,每当SMS警报弹出时,视频将冻结,但textView将继续滚动。通话警报还会使视频中断,导致文本继续滚动时视频冻结,从而导致误报。
However whenever a SMS alert popup, the video will freeze up but the textView will continue to scroll. A call alert will also intrupt the video, causing the video to freeze up while the text continue scrolling, which leads to misallignment.
有什么办法可以修复视频从冻结?还是有什么方法可以检测和处理SMS / Call警报通知?
So is there any way to fix the video from freezing up? Or is there any way to detect SMS/Call alert notifications and handle it?
推荐答案
检查
- (void)applicationWillResignActive:(UIApplication *)application
和
- (void)applicationDidBecomeActive:(UIApplication *)application
UIApplicationDelegate协议的方法。或者您可以捕获
methods of UIApplicationDelegate protocol. Or you can catch
UIApplicationDidBecomeActiveNotification
和
UIApplicationWillResignActiveNotification
通知
这篇关于iPhone如何以编程方式处理SMS /呼叫警报通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!