views:

46

answers:

1

Hey guys,

So I have a UITableView that has a list of image names and corresponding thumbnails, and I'd like to implement some sort of click to expand thumbnails, so when a user clicks on the thumbnail, it expands to fill the whole screen. Is there an easy way to do this? It needs to only expand for the image part of the cell, not the text part (this already has different behavior when clicked).

Thanks in advance.

+1  A: 

How are you displaying the thumbnails on the cell? One possible way is to add the thumbnail as a subview of the cell and bring the subview to the front.

Then override the touch events for that subview (thumbnail) so that upon touch, the image expands to fill the screen. I'm not sure whether the the touches will flow down to the cell, causing the cell's touch events to be fired either.

Luke
In tableView:cellForRowAtIndexPath:, I am just setting cell.imageView.image = imageDisplayed. I've tried to just add a touch event to the image, but it wasn't working correctly. Maybe I just implemented it poorly then? I'll try it again.
Matt
I think for something like this, you're going to want to implement a custom cell view so that you have more control over how it behaves
Luke
I was trying to avoid that, because the problem becomes differentiating between cell selections and images in the cell selections, since I need them to have different behaviors. Maybe a custom cell view is the best option though for this. Is there any way to easily differentiate sub-cell selections?
Matt