Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Custom UITableViewCell Not Responding Properly to setHighlighted

lukeirvinlukeirvin Posts: 388Registered Users @ @
Here's what I need to accomplish:

My UITableView is made up entirely of custom cells.

If a cell is selected the imageView will change.

I need each cell to call setHighlighted so that when a user touches down on the cell they will see the change in the image.

Here's what happens:

The imageView on the cell just flashes. It does not keep the new selected state. so if I touch down, I can see the imageSelected, but when I let go, it stays at imageUnselected.
// this is in my custom cell subclass
- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated
{
     [super setHighlighted:highlighted animated:animated];
    
    if (highlighted)
    {
        self.imageView.highlightedImage = [UIImage imageNamed:@"imageUnselected"];
    }
    else {
        self.imageView.highlightedImage = [UIImage imageNamed:@"imageSelected"];
    }
}

where should I set just the imageView for the cell? In setSelected?

Replies

  • lukeirvinlukeirvin Posts: 388Registered Users @ @
    Still need some help on this one.

    When I'm at my table view, if I tap on a cell I get the desired effect (seeing the new imageView on touch down) but when I release, it does not change to the new imageView. What am I missing?
Sign In or Register to comment.