Hello,
I have a UIScrollView that has three view controllers added to it, as such:
Code:
[scrollView addSubview:islandViewController.view];
On one of them, I'm adding three images in viewDidLoad:
Code:
- (void)viewDidLoad {
[super viewDidLoad];
CGRect myImageRect = CGRectMake(0.0f,0.0f, 320.0f, 480.0f);
UIImageView *sky = [[UIImageView alloc] initWithFrame:myImageRect];
[sky setImage:[UIImage imageNamed:@"sky.png"]];
sky.opaque = YES; // explicitly opaque for performance
[self.view addSubview:sky];
[sky release];
CGRect myImageRect3 = CGRectMake(0.0f,432.0f, 320.0f, 48.0f);
UIImageView *sea = [[UIImageView alloc] initWithFrame:myImageRect3];
[sea setImage:[UIImage imageNamed:@"sea.png"]];
sea.opaque = NO;
[self.view addSubview:sea];
[sea release];
CGRect myImageRect2 = CGRectMake(40.0f,365.0f, 241.0f, 101.0f);
UIImageView *island = [[UIImageView alloc] initWithFrame:myImageRect2];
[island setImage:[UIImage imageNamed:@"island.png"]];
island.opaque = NO;
[self.view addSubview:island];
[island release];
}
When I'm running it on the simulator all images are shown fine. When building and running on the device, only the "sea" image is shown.
I've tried cleaning and re-building, changing the order of the images, looking for lowercase/uppercase issues... All seems fine.
What could be the problem, and more importantly, how could this be fixed?
Thanx in advance,
Nir.