iOS UIView常用方法和属性

UIView常用方法

addSubView:  // 添加子视图
insertSubview: atIndex  // 视图插入到指定索引位置
insertSubview:aboveSubview:  // 视图插入指定视图之上
insertSubview:belowSubview:  // 视图插入指定视图之下
bringSubviewToFront:  // 把视图移动到最顶层
sendSubviewToBack:  // 把视图移动到最底层
exchangeSubviewAtIndex:withSubviewAtIndex:  // 把两个索引对应的视图调换位置
removeFromSuperview:   // 把视图从父视图中移除

UIView常用属性

alpha://透明度
backgroundColor://背景颜色
subViews://子视图集合
hidden://是否隐藏
tag://标签值
superview://父视图
multipleTouchEnabled://是否开启多点触摸
userInteractionEnabled://是否响应触摸事件
原文地址:https://www.cnblogs.com/wb145230/p/4517195.html