How can I bring a view in front of another view, in Swift?

前端 未结 5 756
没有蜡笔的小新
没有蜡笔的小新 2020-12-16 10:37

Below are how my views are organized in IB, top->bottom when the app is started.

The user can do something to make \"Category Table View Header\" temporarily expand

5条回答
  •  Happy的楠姐
    2020-12-16 11:11

    In Swift 5

    To bring a subview to front

    self.view.bringSubviewToFront(yourView)
    

    To send a subview to back

    self.view.sendSubviewToBack(yourView)
    

提交回复
热议问题