2022-03-16(UIView的层级问题)

UIView添加视图层级的几种方式

1、addSubview(view: UIView)//普通添加
2、sendSubviewToBack(view: UIView)//添加到最下层
3、bringSubviewToFront(view: UIView)//添加到最下层
4、insertSubview(view: UIView,atIndex: Int)//添加到制定层
5、insertSubview(view: UIView,belowSubview: UIView)//添加到某个层级的下面
6、insertSubview(view: UIView,aboveSubview: UIView)//添加到摸个层级的上面

修改层级

1、exchangeSubviewAtIndex(index1: Int, withSubviewAtIndex index2: Int)//交换层级

你可能感兴趣的:(2022-03-16(UIView的层级问题))