iOS 如何在视图中添加一个用xib创建的view

NSArray *nib = [[NSBundle mainBundle]loadNibNamed:[pages objectAtIndex:0] owner:self options:nil];
//得到第一个UIView
UIView *tmpCustomView = [nib objectAtIndex:0];
//获得屏幕的Frame
//CGRect tmpFrame = [[UIScreen mainScreen] bounds];
[self.view addSubView:tmpCustomView];

 

posted on 2013-07-04 16:07  Hai_阔天空  阅读(513)  评论(0)    收藏  举报

导航