//加载 xib 文件
//方法一
NSArray *objs = [[NSBundle mainBundle] loadNibNamed:@"Test" owner:nil options:nil];
NSLog(@"%@",objs);
[self.view addSubview:objs[0]];
//方法二
UINib *nib = [UINib nibWithNibName:@"Test" bundle:[NSBundle mainBundle]];
NSArray *objs = [nib instantiateWithOwner:nil options:nil];
[self.view addSubview:objs [0]];
加载 xib 文件
最新推荐文章于 2021-07-28 17:58:08 发布