我在導航欄上的appdelegate文件(不完全在導航欄上)顯示UILabel。它顯示出完美。但沒有觸摸事件正在呼喚它。 Touch僅在狀態欄上工作。請幫忙。提前致謝。觸摸方法不調用appdelegate
這是我的代碼。
CGRect frame=[[UIApplication sharedApplication] statusBarFrame];
backgroundImageView=[[UILabel alloc] initWithFrame:CGRectMake(0, frame.size.height, 320, 44)];
backgroundImageView.tag=50;
[backgroundImageView setTextAlignment:UITextAlignmentCenter];
[backgroundImageView setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"music.png"]]];
[self.window addSubview:backgroundImageView];
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
NSLog(@"in touched");
}
u初始化根視圖?????? – iPatel