I am presenting a modal view with a UIImageView set to content mode fill scale (via the xib). I am setting a UIImage in the modal view class with a thumbnail from the parent class :
NSURL * finishedMovie = [self applicationDocumentsDirectory:@"FinishedVideo.mov"];
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:finishedMovie];
UIImage *thumbnail = [player thumbnailImageAtTime:1.0 timeOption:MPMovieTimeOptionNearestKeyFrame];
previewScreen = [[PreviewScreenViewController alloc]initWithNibName:@"PreviewScreenViewController" bundle:nil];
previewScreen.thumbnailImage = thumbnail;
[self presentModalViewController:previewScreen animated:YES];
Then in the modal view class itself :
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
previewImageBox.image = thumbnailImage;
}
The problem is that when the view appears, it seems to be ignoring the content mode set in the xib and just inserting the image at full size.
This seems like a bug, as when I return to this view the image fits in the UIImage view properly.
Can anyone help ?
Thanks.