Multiview Applications(多個xib之前的切換) view controller和xib文件是如何關聯在一起的 (手動關聯 view controller和xib文件)


參考: http://www.cnblogs.com/minglz/archive/2012/12/11/2809368.html

 

一個view 用兩個xib 文件的代碼實例:

if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) 
{ 
    YourViewController *vc = [[[YourViewController alloc] initWithNibName:@"YourViewController_iPhone
" bundle:nil] autorelease];   //加載iphone  的界面
} else
{ 
YourViewController *vc = [[[YourViewController  alloc] initWithNibName:@"YourViewController_iPad" bundle:nil] autorelease];  //加載ipad的界面
}

 

知識點:

point在非retina屏幕中是20px,在retina屏幕中是40px

iphone4屏幕的大小是320*480 point   如果是普通屏幕,則其像素是 320*480,retina 屏幕是 640*960 px


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM