ナビゲーション バーの appdelegate ファイルに UILabel を表示しています (正確にはナビゲーション バーではありません)。完璧に見せています。しかし、それを呼び出すタッチイベントはありません。タッチはステータスバーでのみ機能します。助けてください。前もって感謝します。
これが私のコードです。
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");
}