3

I've got several UI elements on my screen (programmatically) and am in need of an efficient way to give each subview a z-index setting, so I can stack certain elements over others.

Does anyone have a solution to this?

Dave Clemmer
  • 3,741
  • 12
  • 49
  • 72
Don Wilson
  • 558
  • 2
  • 8
  • 21

1 Answers1

9

The plain -addSubview: method will add the new view on top of its siblings.

There are also a bunch of methods like bringSubviewToFront:, insertSubview:belowSubview:, etc. that you can use to manipulate the ordering, listed under "Managing the View Hierarchy" in the UIView Reference

David Gelhar
  • 27,873
  • 3
  • 67
  • 84