i have a simple class named Splashes that animate three images on startup.
It works well, but now on iPhone 5 I'm not able to automatically resize the view.
Here the code snippets:
- (void)viewDidLoad
[...]
if ( IS_IPHONE_5 ) _ImageSplash.image = [UIImage imageNamed:@"splash_1-568h@2x.png"];
else _ImageSplash.image = [UIImage imageNamed:@"splash_1.png"];
if ( IS_IPAD ) _ImageSplash.image = [UIImage imageNamed:@"splash_1_ipad.png"];
[NSTimer scheduledTimerWithTimeInterval:1.5 target:self selector:@selector(repeat) userInfo:nil repeats:YES];
[...]
}
Repeat function
[...]
int i=0;
[...]
- (void)repeat
{
switch (i) {
case 0:
if ( IS_IPHONE_5 ) _ImageSplash.image = [UIImage imageNamed:@"splash_2-568h@2x.png"];
else _ImageSplash.image = [UIImage imageNamed:@"splash_2.png"];
if ( IS_IPAD ) _ImageSplash.image = [UIImage imageNamed:@"splash_2_ipad.png"];
break;
case 1:
if ( IS_IPHONE_5 ) _ImageSplash.image = [UIImage imageNamed:@"splash_3-568h@2x.png"];
else _ImageSplash.image = [UIImage imageNamed:@"splash_3.png"];
if ( IS_IPAD ) _ImageSplash.image = [UIImage imageNamed:@"splash_3_ipad.png"];
break;
default: [self dismissModalViewControllerAnimated:NO]; break;
}
i++;
}
The images are correctly loaded, based on device, but the xib remain the same.
Don't want to autosize.
These are the settings of my XIB:
What's could be the problem?
All others XIB works well, I have a problem only with this.
iOS show me a black stripe only on the bottom of the view! Very strange...
Note: I can't use AUTOLAYOUTS because it's an 3.2+ app compatibile.
Edit: Added screenshot.
thanks.
I think CSmith's reply should have worked, but, anyways, may be this'd do the trick:
CGRect windowFrame=[[[UIApplication sharedApplication].windows objectAtIndex:0] bounds];
[_ImageSplash setFrame:windowFrame];
Put it under the iPhone5 check i.e. when device is iPhone5.