- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在开发一个用作电子邮件客户端的 iOS 应用程序。我的 Storyboard中的一个 View 是一个收件箱,其中为每封电子邮件显示:消息的发件人、对话的标题、消息正文的开头以及消息发送的日期和时间。 (在 TableView 中)如果尚未阅读消息,我如何将这些文本以粗体显示,并在用户点击消息后以正常样式显示?谢谢 !
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
messageTableViewCell *cell = (messageTableViewCell *)[tableView dequeueReusableCellWithIdentifier:cellidentifier];
// Configure Cell
NSDictionary *currentMessage = [self.unreadmessagesArray objectAtIndex:indexPath.row];
cell.nom.text = [currentMessage valueForKey:@"sentBy"];
cell.titre.text = [currentMessage valueForKey:@"messageThreadTitle"];
cell.resume.text = [currentMessage valueForKey:@"messageBody"];
cell.date.text = [currentMessage valueForKey:@"sentOn"];
return cell;
最佳答案
需要做两件事:1.在服务器端保存已读/未读状态,如果你想一直保存结果。2. 你必须在你的最后设置一个键值对 isSelected (TRUE OR FALSE)。
- (void) viewDidLoad {
// data coming from server keep in array having a dictionary
unreadmessagesArray = [[NSMutableArray alloc] init];
[unreadmessagesArray addObject:[NSDictionary dictionaryWithObjectsAndKeys:@"value", @“someOtherkey", [NSNumber numberWithBool:FALSE], @"isSelected", nil]];
[unreadmessagesArray addObject:[NSDictionary dictionaryWithObjectsAndKeys:@"value", @"someOtherkey", [NSNumber numberWithBool:FALSE], @"isSelected", nil]];
[unreadmessagesArray addObject:[NSDictionary dictionaryWithObjectsAndKeys:@"value", @"someOtherkey", [NSNumber numberWithBool:FALSE], @"isSelected", nil]];
[unreadmessagesArray addObject:[NSDictionary dictionaryWithObjectsAndKeys:@"value", @"someOtherkey", [NSNumber numberWithBool:FALSE], @"isSelected", nil]];
]
}
在 cellForRowAtIndexPath 中:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
messageTableViewCell *cell = (messageTableViewCell *)[tableView dequeueReusableCellWithIdentifier:cellidentifier];
NSDictionary *currentMessage = [self.unreadmessagesArray objectAtIndex:indexPath.row];
cell.nom.text = [currentMessage valueForKey:@"sentBy”];//someOtherkey
cell.titre.text = [currentMessage valueForKey:@"messageThreadTitle”];//someOtherkey
cell.resume.text = [currentMessage valueForKey:@"messageBody”];//someOtherkey
cell.date.text = [currentMessage valueForKey:@"sentOn”];//someOtherkey
if([currentMessage valueForKey:@“isSelected”]) {
[cell.titre setFont:[UIFont boldSystemFontOfSize:10]];
}
else {
[cell.titre setFont:[UIFont systemFontOfSize:10]];
}
return cell;
}
现在在 didSelectRowAtIndexPath 中:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSDictionary *currentMessage = [self.unreadmessagesArray objectAtIndex:indexPath.row];
[currentMessage setValue:[NSNumber numberWithBool:YES] ForKey:@“isSelected” ];
}
关于ios - xcode中的已读和未读消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25303117/
我正在尝试实现类似于电子邮件中的已读/未读的功能。我如何通过使用 jquery、php 和 mysql 来实现。我想分步执行的操作: 1- 当我单击 html 表中的一行时,我更改了此消息在数据库中的
如何确定消息状态(已读/未读)。聊天是通过 XMPP 协议(protocol)实现的。 最佳答案 XEP-0184 : Message Delivery Receipts 支持在消息已送达时通知发件人
上下文:我们正在实现一个新闻应用程序。现在,您可以假设所有用户的新闻都是相同的,并根据我们设置的参数(根据趋势和日期)维护订单。 问题:我们不确定跟踪用户阅读内容的最佳实现是什么。我们希望能够配置一种
好吧,另一个有趣的问题是 50 号公路。 我们想实现一个真正的论坛灯泡系统,其中用户未读的帖子(在创建用户帐户后)显示为未读,直到该状态被清除或直到用户阅读它们。 我们认为最好和最简单的方法是实现一个
我正在使用来自 google reader's API 的数据开发应用程序并使用 GData用于登录。 我希望能够将表格单元格内的帖子标记为已读/未读,但我发现这主要是未记录的,很难找到解决方案,有什
我的 C 程序已从 Linux 上的 TCP 套接字读取(使用 read(2) 或 recv(2))几个字节。是否可以将这些字节推回,以便后续的 read(2) 和 recv(2) 调用(在我无法控制
我是一名优秀的程序员,十分优秀!