ios - UITableView 单元格模糊读取项目

标签 ios objective-c xcode uitableview

我有一个我一直在做的简单的 iOS 应用程序项目。表格 View 显示从 Web 服务(RSS 提要)获取的条目并点击其中之一转到 Web View 。

使用以下内容,我正在检查项目是否已被读取,如果是,它会使用 setAccessoryType 放置一个复选标记以指示该项目已被读取:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{

    ItemFeed *entry = [[channel items] objectAtIndex:[indexPath row]];

    [[MyFeedStore sharedStore] markItemAsRead:entry];
    [[[self tableView] cellForRowAtIndexPath:indexPath] setAccessoryType:UITableViewCellAccessoryCheckmark];

}

以上代码产生以下结果:

enter image description here

我想要的是使单元格模糊以表明它已被读取。我将 TechCrunch iPhone 应用程序中的以下图片作为我想要的示例:

enter image description here

提前致谢。

更新:我曾尝试更改 didSelectRowAtIndexPath 中的文本颜色,但没有成功:

ItemsViewCell *cell = (ItemsViewCell *)[tableView dequeueReusableCellWithIdentifier:@"ItemsCell"];
cell.titleLabel.textColor = [UIColor redColor]; //Red color is just for checking right now

最佳答案

尝试添加以下代码。

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath  {
    ItemsViewCell *cell = (ItemsViewCell*)[tableView cellForRowAtIndexPath:indexPath];
    cell.titleLabel.textColor = [UIColor redColor]; //Red color is just for checking right now
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
}

关于ios - UITableView 单元格模糊读取项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16104069/

相关文章:

c# - iOS 7 不断在空字典上发送 IDLE 命令

objective-c - 弹出本地通知后打开特定的 View Controller

ios - 使用场景套件无法在场景背景中看到视频

ios - PencilKit-ITMS-90338 : Non-public API usage when uploading app to AppStoreConnect

Xcode 外部工具 cpplint

ios - 在 UITextView iOS 7 中添加插图的 Storyboard

ios - iOS 应用程序中的 Facebook 发送对话框

ios - 在 Swift 中用包含时间的字符串替换当前日期

ios - 从 JSON 响应中获取货币符号 unicode 字符以呈现在 UILabel 中

ios - EZAudio iOS - 将波形保存到图像