OGeek|极客世界-中国程序员成长平台

标题: ios - 当应用程序在后台运行时显示 UIAlert? [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 01:51
标题: ios - 当应用程序在后台运行时显示 UIAlert?

UIAlertView *alertView = [[UIAlertView alloc] initWithTitle"open app" message" backgr..." delegate:nil cancelButtonTitle"OK" otherButtonTitles:nil];

[alertView show];

应用程序在后台运行时如何显示警报?



Best Answer-推荐答案


使用 UILocalNotification当您的应用在后台时。

UILocalNotification *notification = [[UILocalNotification alloc] init];
notification.alertBody = @"Your message";
notification.alertAction = @"Open app";
[[UIApplication sharedApplication] presentLocalNotificationNow:notification];

关于ios - 当应用程序在后台运行时显示 UIAlert?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15702730/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4