//UIview给大小
UIView *redview = [[UIView alloc]initWithFrame:CGRectMake(20, 20, 100, 100)];
// 给颜色
redview.backgroundColor = [UIColor redColor];
// tag值(用来标记控件)
redview.tag = 10002;
// 添加到view上
[self.window addSubview:redview];
//控制子视图
(1)[self.window bringSubviewToFront: aview];
(2)[self.window sendSubviewToBack:bview];
(3)[self.window insertSubview:greenview atIndex:0];
网友评论