I am developing an app. In the app I wrote the code for a 3.5-inches screen and 4-inches screen for ios7&ios6. I took one view controller; in this view controller I want to display two images, one for the top and another for the bottom. On the ios7 3.5-inch screen and 4 inches screen there is no problem with the display. But on the ios6 screen for 4-inches screen and 3.5 inches screen, there is a display problem. The two images are not displayed properly. I don't know how to write the same code for both the ios6 and ios7 for 4-inches& 3.5 inches screen. Please give me ideas, anyone. I am new to programming. Thanks in advance.
The below is my code.
Viewcontroller.m (3.5 inches and 4-inches screen for ios7 & ios6).
if ([[UIScreen mainScreen] bounds].size.height == 568)
{
imgLogo=[[UIImageView alloc]initWithFrame:CGRectMake(75, 65, 162, 57)];
imgLogo.image=[UIImage imageNamed:@"Logo-01.png"];
[self.view addSubview:imgLogo];
imgBuilding=[[UIImageView alloc]initWithFrame:CGRectMake(8, 415, 300, 153 )];
imgBuilding.image=[UIImage imageNamed:@"image-02.png"];
imgBuilding.alpha=0.4;
[self.view addSubview:imgBuilding];
}
else
{
imgLogo=[[UIImageView alloc]initWithFrame:CGRectMake(75, 70, 162, 57)];
imgLogo.image=[UIImage imageNamed:@"Logo-01.png"];
[self.view addSubview:imgLogo];
imgBuilding=[[UIImageView alloc]initWithFrame:CGRectMake(0, 345, 320,140 )];
imgBuilding.image=[UIImage imageNamed:@"image-02.png"];
imgBuilding.alpha=0.4;
[self.view addSubview:imgBuilding];
}