Charlie
Charlie

Reputation: 335

CALayer and UIView display order

I have a CATiledLayer within a UIView and the UIView also contains a subview. How can I make sure that the subview is always drawn above the layer?

Most of the time I get the tile layer covering the subview.

Upvotes: 2

Views: 3126

Answers (1)

kennytm
kennytm

Reputation: 523304

By default all layers (hence views) added in the last are drawn on the top. You can change the default with -insertSublayer:below: and similar methods:

 [view.layer insertSublayer:tiledLayer below:thatSubview.layer]

Upvotes: 11

Related Questions