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