【iOS开发】addSubview 方法

        //TEST
        UIView *baseView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 100, 100)];
        UIView *addView1 = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 70, 70)];
        UIView *addView2 = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 50, 50)];
        [baseView addSubview:addView1];
        [baseView addSubview:addView2];
        NSLog(@"MARKLEVEL:subviews:%@",baseView.subviews);
        [baseView addSubview:addView2];
        [baseView addSubview:addView1];
        NSLog(@"MARKLEVEL:subviews after:%@",baseView.subviews);
MARKLEVEL:subviews:(
    ">",
    ">"
)
MARKLEVEL:subviews after:(
    ">",
    ">"
)

你可能感兴趣的:(【iOS开发】addSubview 方法)