[英]Customize interactive notification buttons
您可以通過更改按鈕標題的值來自定義按鈕標題,這是一個示例:
UIAlertView* alert; alert = [[UIAlertView alloc] initWithTitle:@"Reminder" message:@"Reminder" delegate:nil cancelButtonTitle:@"Mark as Completed" otherButtonTitles: @'Later']; [alert show]; [alert release];
這是帶有推送通知的示例:
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))handler
{
if (application.applicationState == UIApplicationStateActive) {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Reminder" message:userInfo[@"Reminder"][@"alert"] delegate:nil cancelButtonTitle:@"Mark as Completed" otherButtonTitles:@"Later"];
[alertView show];
}
else if (application.applicationState == UIApplicationStateBackground || application.applicationState == UIApplicationStateInactive) {
}
}
不,沒有辦法更改此標題,這將是關閉選項。
提醒應用程序具有不同的情況,它僅帶有iOS版本。 所以基本上是這樣編碼的
但是在應用程序開發中,我們可以更改它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.