Creating UITableViewCells with “unread” blue dots

There is no straightforward built in functionality for this. What you can do is create the blue dots (or whatever image you like) and set the cell.imageView.image property. I asked on stackoverflow about a problem I faced which is the images weren’t looking nice when a cell is selected. Here is how it looked (first image for “unread” cells and  second for “read” cells)

What is needed is to set a transparent background for the images. Thanks to this post I found a way of masking the images. I’m using the function posted on that website with the following images. Blue dot for “unread” cells, white dot for “read” mails, and the mask image. Feel free to use these images but they are not the typical shiny iphone images. If you know how to make one of those please comment.

2 thoughts on “Creating UITableViewCells with “unread” blue dots

  1. Hi kovallux. It’s been a while since I looked at the code so I can’t give you detailed information. It’s easy though. Here is what I did,

    - Defined “viewed” field in my table, which can be 0 or 1 (for some reason I was having trouble with boolean types so I decided to use int32).
    - Whenever a row gets inserted, the viewed value will be 0, meaning “not viewed”
    - Inside tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath method I have,

    if ([videoTag.Viewed intValue] == 0) {
    cell.imageView.image = [self.mAppDelegate mImageBlue];
    }else {
    cell.imageView.image = [self.mAppDelegate mImageWhite];
    }

    where mAppDelegate is my app delegate and I initialize mImageBlue and mImageWhite inside my app delegate.

    Try it. It shouldn’t be hard.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>