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

posted @ 2013-05-24 18:27  ygm900  阅读(9566)  评论(0编辑  收藏  举报