Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITableView Cell Blur Read Items

I have a simple iOS app project that i have been working on. The tableview shows entries that are fetched from a web service (rss feed) and tapping on one of them segues to the web view.

Using the following, i am checking if the items has been read, and if yes that it puts a check mark using setAccessoryType to indicate that the item has been read:

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

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

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

}

The above code is resulting in the following:

enter image description here

What i want is the cell to be blurred to indicate that it has been read. I am putting the following image from TechCrunch iPhone app as an example for what i want:

enter image description here

Thanks in advance.

UPDATE: I have tried changing the text color in didSelectRowAtIndexPath but it didn't work:

ItemsViewCell *cell = (ItemsViewCell *)[tableView dequeueReusableCellWithIdentifier:@"ItemsCell"];
cell.titleLabel.textColor = [UIColor redColor]; //Red color is just for checking right now
like image 759
Jessica Avatar asked Jan 24 '26 20:01

Jessica


2 Answers

Try adding the following code.

- (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];
}
like image 165
Alexander Merchi Avatar answered Jan 27 '26 11:01

Alexander Merchi


It looks like you need to change the textColor property of the label in your cell to a color similar to the Tech Crunch app's textColor.

like image 23
bbraunj Avatar answered Jan 27 '26 11:01

bbraunj



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!