NSBundle* bundle = [ NSBundle mainBundle];
//加载xib中的view
UIview* subView = [[bundle loadNibNamed:@“xibName” owner:nil options:nil] lastObject];
[self.view addSubview subView];
//获取subView的子控件 按照xib中控件的顺序取得子控件
UIImageView*imageView = subView.subViews[0];
= [subView viewWithTag:0];
网友评论