// 随机颜色
view1.backgroundColor = [UIColor colorWithRed:arc4random() % 256 / 255.0 green:arc4random() % 256 / 255.0  blue:arc4random() % 256 / 255.0  alpha:1];
// 单独改变frame
view1.frame = CGRectMake(0, 0, 100, 100);
// 改变中心点坐标
view1.center = CGPointMake(130, 100);
// 是否隐藏视图
view1.hidden = NO;
// 改变视图透明度
view1.alpha = 0.5;
// 获取父视图
UIView *superV = view1.superview;
// 改变父视图背景颜色
superV.backgroundColor = [UIColor yellowColor];

// 获取子视图
// subviews为一数组 当执行addSubview将一个视图贴到父视图的时候, 会将子视图对象添加到subviews数组中
self.view.subviews.firstObject.backgroundColor = [UIColor grayColor];
// 视图层次管理
// 将self.view的子视图aview放到所以视图的最前端;
[self.view bringSubviewToFront:dView];
// 把指定的子视图移动到最后面
[self.view sendSubviewToBack:cView];
// 交换两个指定索引位置的子视图
[self.view exchangeSubviewAtIndex:0 withSubviewAtIndex:2];
// 把子视图从父视图上移除
[eView removeFromSuperview];

屏幕快照 2016-01-14 下午8.49.03.png