There are three simulator or iPhone devices, as given below
iPhone
iPhone (Retina 3.5 inch)
iPhone (Retina 4 inch)
I want to implement the following method, for navigation bar.
- (UINavigationController *)navigationController {
nav = [[UINavigationController alloc]
initWithRootViewController:[self demoController]];
// If Iphone/iPod Touch
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
// If iPhone 5 or new iPod Touch
NSLog(@"The height is %f ", [UIScreen mainScreen].bounds.size.height );
NSLog(@"The width is %f ", [UIScreen mainScreen].bounds.size.width);
if([UIScreen mainScreen].bounds.size.height == 568){
[nav.navigationBar setBackgroundImage:[UIImage imageNamed:@"nav.png"] forBarMetrics: UIBarMetricsDefault];
} else{
// Regular iPhone
[nav.navigationBar setBackgroundImage:[UIImage imageNamed:@"nav_classic.png"] forBarMetrics: UIBarMetricsDefault];
}
}
return nav;
}
I want to know proper size of Navigation image, nav.png, and condition, so that i can work for all three devices.
As I used 320x44 for nav classic, but it looks small in device iPhone (Retina 3.5 inch) So, As I use nav.png for all, its looks bigger iPhone
1. What are proper sizes of UINavigationBar?
2. What is proper logic to use them?
Thanks