UIView使用nib文件

    NSArray * nib = [[NSBundle mainBundle] loadNibNamed:@"DishDetailTopView" owner:self options:nil];
    DishDetailTopView * view = [nib objectAtIndex:0];//通过nib文件生成的view
    view.backgroundColor = [UIColor orangeColor];
    [_scrollView addSubview:view];

 

posted @ 2013-04-23 15:59  Dadada胖纸er  阅读(172)  评论(0编辑  收藏  举报