[英]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
幻燈片是UIViewController
, touchesBegan
僅在UIView
上調用。 您需要將UIView
子類化以捕獲觸摸。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.