आप इन छवियों के साथ मदद करने के लिए मेरी #define
s का उपयोग कर सकते हैं:
#define isPhone568 ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone && [UIScreen mainScreen].bounds.size.height == 568)
#define iPhone568ImageNamed(image) (isPhone568 ? [NSString stringWithFormat:@"%@-568h.%@", [image stringByDeletingPathExtension], [image pathExtension]] : image)
#define iPhone568Image(image) ([UIImage imageNamed:iPhone568ImageNamed(image)])
बस अपनी छवियों [email protected] अंकन देते हैं, और iPhone568ImageNamed
का उपयोग मानक नाम या iPhone 5 के लिए एक नाम पाने के लिए/नया आइपॉड। टिप्पणियों से
प्रयोग उदाहरण:
self.view.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:iPhone568ImageNamed(@"mainscreen.png")]];
स्रोत
2012-09-20 19:05:03
संबंधित जानकारी के लिए http://stackoverflow.com/questions/12518879/extend-app-for-iphone-5-best-practice देखें, जो केवल है "सम्मेलन" जो अस्तित्व में प्रतीत होता है। अन्यथा, पहले के रूप में @ 2x का उपयोग करना जारी रखें। –