【发布时间】:2013-09-08 02:43:48
【问题描述】:
我有一个名为 SplashViewController 的 UIViewController 实例。我将它添加到 AppDelegate 的主窗口中,如下所示:
splashViewController = [[SplashViewController alloc]initWithNibName:@"SplashScreen" bundle:[NSBundle mainBundle]];
splashViewController.view.frame = [UIScreen mainScreen].bounds;
[self.window setBackgroundColor:[UIColor blackColor]];
self.window.frame=[UIScreen mainScreen].bounds;
window.rootViewController = splashViewController;
[window makeKeyAndVisible];
我必须在 SplashViewController 中处理触摸事件,并且我需要在程序中将 userInteractionEnabled 设为 YES 和 NO。由于某种原因,我下面的代码无效
[self.view setUserInteractionEnabled:NO]; // YES also have no effect
无论我在上面设置 YES 还是 NO,都会触发我的 touchesBegan 函数。 SplashViewController 有一个带有图像和简单动画的图像视图。
我还可以在哪里寻找为什么 userInteraction 没有按照我想要的方式运行?我尝试更改情节提要中设置的值,但没有帮助(无论如何程序设置应该覆盖情节提要设置,我猜)。
任何帮助/指针请...在此先感谢
【问题讨论】:
标签: ios objective-c touch