如何为具有uilocalnotification的细胞提供单独的颜色

时间:2014-05-26 09:57:29

标签: ios uilocalnotification

我已将LocalNotification设置如下,并且工作正常 现在我的问题是..如果我打开看到通知,我想为UITableView中的单元格提供一些颜色,我已收到通知。明确地......正在进行账单提醒项目并且我正在设置提醒完美..现在我想给收到通知的账单单独的颜色.. 请帮助我......" ttt"是最后插入的帐单行。

一些陈述

UILocalNotification *localNotification = [[UILocalNotification alloc] init];
localNotification.fireDate = [NSDate dateWithTimeIntervalSinceNow:180];
localNotification.alertBody = [NSString stringWithFormat:@"%@",sometext];
localNotification.soundName = UILocalNotificationDefaultSoundName;

id var = [NSNumber numberWithInteger: ttt];
[localNotification.userInfo setValue:var forKey:@"id"];

[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];

一些陈述

1 个答案:

答案 0 :(得分:0)

您必须在此处应用简单的编程逻辑。 只需为该特定余数设置一些标志值,并在tableview单元格中加载时,只需检查单元格中的剩余加载是否具有本地通知。 并相应地更改单元格的颜色。

更多:如果您想检查剩余部分是否已过期,您可以按照以下步骤操作:

1。设置剩余日期时,只需存储该日期。

2。当您加载单元格时: 比较该特定剩余部分的保存日期与当前日期

if(剩余日期>当前日期)

设置绿色图像或其他任何表示记录器尚未过期的图像

否则

设置红色图像,表示reamainder已经过期。

P.S:使用逻辑