ios - 获取屏幕上的所有触摸

标签 ios ios6 c4

我有一个小问题。我想接收屏幕上的所有触摸,并为每个触摸生成一个新视频。问题是,一旦放置了视频,它就会拦截触摸点。我尝试了各种值进入 locationInView 但到目前为止没有任何运气。我找对地方了吗?

 -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {

    CGPoint pointOnScreen = [[touches anyObject] locationInView:self.view];

    C4Movie *player = [C4Movie movieNamed:@"inception.mov"];
    player.shouldAutoplay = YES;
    player.loops = YES;
    player.center = pointOnScreen;
    [self.canvas addMovie:player];

 }
 @end

最佳答案

尝试将每个视频屏幕的 userInteractionEnabled 属性(假设它保存在某种 UIView 中)设置为 NO - 这样,触摸事件将通过它并继续由您的处理程序接收。

关于ios - 获取屏幕上的所有触摸,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14618686/

相关文章:

ios - AppCode:关闭自动匹配大括号

ios - 获取元素的当前约束

iphone - 所有 View 中的 Ios 音频播放器

ios - 如何调整 C4Label 的字距调整?

ios - 如何在 C4 中生成随机数? [C4框架]

ios - sqlite3 在 iOS 9.0 设备中崩溃

ios - 如何从 map 图钉上的披露按钮调用 segue?

ios - 在应用启动时通过splitviewcontroller呈现模式viewcontroller

ios - NSURLConnectionDownloadDelegate destinationURL

c4 - 在 XCODE 中编译 c4iOS 应用程序时出错