簡體   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