uiview关联xib

1,在需要实例的地方

//加载一个uiview的作法

[LotteryInvestigationView *lotteryInvestigationView=[[[NSBundle mainBundle] loadNibNamed:@"LotteryInvestigationView" owner:self options:nil] lastObject];

[lotteryInvestigationView setFrame:frame];

[self addSubview:lotteryInvestigationView];

 

2,file's ower 对应的custom class 为uiview

 

3,对应的view的custom class 设为你自定义的view类

 

这样就ok了

 

posted on 2016-11-04 18:58  dreamDeveloper  阅读(210)  评论(0编辑  收藏  举报

导航