UIView创建的两种方式

    //通过xib创建
    NSBundle    * bundle = [NSBundle mainBundle];
    NSArray     * arr = [bundle loadNibNamed:@"myView" owner:self options:nil];
    UIView      * myView = [arr objectAtIndex:0];
    
    //通过代码创建
    CGRect      viewRect = CGRectMake(0, 0, 100, 100);
    UIView      * myView = [[UIView alloc] initWithFrame:viewRect];

 

posted @ 2013-09-18 17:28  Dadada胖纸er  阅读(185)  评论(0编辑  收藏  举报