私は Xcode に比較的慣れていません。非常に単純な目覚まし時計を作成しています。以下はアプリの小さなスニペットです。私の質問は次のとおりです。アラームが発生したときにカスタムビュー(つまり、写真またはアニメーション)を表示し、その上に「閉じる」ボタンを配置する方法は?前もって感謝します
ニコラ
- (void) scheduleLocalNotificationWithDate:(NSDate *)fireDate :(NSString *)message
{
UILocalNotification *notificaiton = [[UILocalNotification alloc] init];
if (notificaiton == nil)
return;
notificaiton.fireDate = fireDate;
notificaiton.alertBody = message;
notificaiton.timeZone = [NSTimeZone defaultTimeZone];
notificaiton.alertAction = @"View";
notificaiton.soundName = @"alarm-clock-1.mp3";
notificaiton.applicationIconBadgeNumber = 1;
notificaiton.repeatInterval = kCFCalendarUnitWeekday;
NSLog(@"repeat interval is %@",notificaiton.description);
[[UIApplication sharedApplication] scheduleLocalNotification:notificaiton];