2012-09-27 15 views
5

Tam ekran degrade arka plana sahip bir iOs uygulamasına sahibim. Şimdi, iphone 5 ekran boyutu ile farklı ve tabii ki 5. ve 4. aygıtları desteklemek istiyorum.iOS 6 arka plan resmi

Bunu yapmanın önerilen yolu nedir? Ben yorumunda bağlantılı yazı itibaren

cevap

1

#import <sys/utsname.h> 

NSString* 
machineName() 
{ 
struct utsname systemInfo; 
uname(&systemInfo); 

return [NSString stringWithCString:systemInfo.machine 
          encoding:NSUTF8StringEncoding]; 
} 

sonucu olmalıdır: Ben bu son için @ "iPhone5,1" gibi bir şey dönecektir farz ediyorum

@"i386"  on the simulator 
@"iPod1,1" on iPod Touch 
@"iPod2,1" on iPod Touch Second Generation 
@"iPod3,1" on iPod Touch Third Generation 
@"iPod4,1" on iPod Touch Fourth Generation 
@"iPhone1,1" on iPhone 
@"iPhone1,2" on iPhone 3G 
@"iPhone2,1" on iPhone 3GS 
@"iPad1,1" on iPad 
@"iPad2,1" on iPad 2 
@"iPhone3,1" on iPhone 4 
@"iPhone4,1" on iPhone 4S 

modeli. Sonra sadece bu

+1

Programı yolu açıktır çalışır bana bildirin

NSString *iphoneType = machineName(); if ([iphoneType [email protected]"iPhone5,1"]){ //image for iphone 5 } else { //image for the rest } 

gibi bir kontrolü yap. "Apple tarafından onaylanmış" bir şey olabilir mi? @xxx name, vb ile görüntülere sahip olmak gibi –

+0

Tüm arka plan bir görüntü olduğunu mu söylüyorsunuz? – TheJer

+0

olduğunu varsayalım :) –