当 Push Notification AlertView 出现在视图上时如何突出显示特定的视图区域?

Posted

技术标签:

【中文标题】当 Push Notification AlertView 出现在视图上时如何突出显示特定的视图区域?【英文标题】:How to Highlight the particular area of view when Push Notification AlertView Appears on View? 【发布时间】:2016-06-21 10:30:04 【问题描述】:

我是 ios 应用程序开发的新手...

我有一个 View on which push logo Area 。 我也有一个PushNotificationAlertView 在我看来。

现在我的问题是,当我的PushNotificationAlertView 出现时,我可以像关注突出显示推送徽标区域一样吗?

警报来自UIUserNotificationSettingsAppDelegate.m

UIUserNotificationSettings* notificationSettings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound categories:nil];
    [[UIApplication sharedApplication] registerUserNotificationSettings:notificationSettings];
    [[UIApplication sharedApplication] registerForRemoteNotifications];

我收到如下图所示的警报

但是我想要喜欢下面的图片请帮帮我

我该怎么做? 请帮助我。:)

【问题讨论】:

你想要什么?您刚刚为标签 Push Logo 设置了背景? @rohitSidpara 谢谢我希望在警报视图中突出显示特定区域视图 您可以使用自定义 uialertview 或 toast 标签来实现此目的。 警报来自 UIUserNotificationSettings* notificationSettings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound categories:nil]; [[UIApplication sharedApplication] registerUserNotificationSettings:notificationSettings]; [[UIApplication sharedApplication] registerForRemoteNotifications]; 我们如何自定义警报 【参考方案1】:

使用自定义视图或标签使其突出显示。

使用以下代码通知您的视图控制器。

Use Notifier

通过链接在下面的函数中添加您的 sn-p

if ([[notification name] isEqualToString:@"TestNotification"]) 
//highlight the view or label by changing color or text or what you want

【讨论】:

以上是关于当 Push Notification AlertView 出现在视图上时如何突出显示特定的视图区域?的主要内容,如果未能解决你的问题,请参考以下文章

当 Push Notification AlertView 出现在视图上时如何突出显示特定的视图区域?

Push Notification 的后台处理

Ionic Cordova:Push Notification 插件 onMessage 接收消息。

PhoneGap Notification.Alert 不起作用

使用 react-native-push-notification,App 在收到新的 FCM 通知时崩溃

Apple Push Notification Service 用户响应