繁体   English   中英

UITouch不检测

[英]UITouches not detecting

我的UItouches没有在我的Slidenib文件中检测到。 问题是什么? 有人可以帮忙吗?


@class Slideshow;
@interface RootViewController : UIViewController{
PreferencesController *preferencesController;
Slideshow *slideshow;}

幻灯片实施

@implementation Slideshow
- (void) touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event
{
NSLog(@"touches begin");
}
- (void)viewDidLoad
{

UIImageView *frontView = [[UIImageView alloc] initWithFrame:self.view.bounds];
frontView.backgroundColor = [UIColor blackColor];
frontView.image = [UIImage imageNamed:@"apple.png"];
frontView.userInteractionEnabled = YES;

[self.view addSubview:frontView];

[frontView release];
}@end

幻灯片是UIViewControllertouchesBegan仅在UIView上调用。 您需要将UIView子类化以捕获触摸。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM