views:

48

answers:

1

I'm setting a UIImageView into my table cells during - (UITableViewCell *)tableView:(UITableView *)tableVw cellForRowAtIndexPath:(NSIndexPath *)indexPath

They are stretchable images (created with stretchableImageWithLeftCapWidth)

How can I update their size when my table view is rotated to another orientation?

A: 

First, create an IBOutlet for each object to be resized. Open interface builder and connect the outlets to your file's owner.

You will need to override the method

willAnimateFirstHalfOfRotationToInterfaceOrientation:duration

This is for making changes that will happen before the roation animation is finished, or you could use

willAnimateSecondHalfOfRotationToInterfaceOrientation:duration

if you want the new positioning to occur at the same time the rotation finishes.

Inside the animate method, you will redraw the frame depending on which orientation the phone is now in: Example:

button1.frame = CGRectMake(20, 20, 125, 125);

IcyBlueRose
So, maybe i should create a UIImageView iboutlet that resized automatically, but instead of setting the image in IB, I use the setImage method and it might all go well. I'll try.
E-Madd
I actually ended up using the autoresizingMask property, but this got me on the right path. Thanks.
E-Madd
Great! Glad you got it working!
IcyBlueRose