gpt4 book ai didi

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

转载 作者:塔克拉玛干 更新时间:2023-11-01 19:10:10 26 4
gpt4 key购买 nike

我有一个我一直在做的简单的 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com