12

I would like to be able to addSubview beneath another already existing UIView, how can I do that? I haven't been able to find anything on this.

halfer
  • 19,824
  • 17
  • 99
  • 186
Josh Kahane
  • 16,765
  • 45
  • 140
  • 253

3 Answers3

28

How about the UIView method: insertSubview:belowSubview:.
It's right there in the "Managing the View Hierarchy" section of the UIView docs.

Kevin Jantzer
  • 9,215
  • 2
  • 28
  • 52
rdelmar
  • 103,982
  • 12
  • 207
  • 218
8

you can use :

[self.view insertSubview:topview belowSubview:buttomView];
shannoga
  • 19,649
  • 20
  • 104
  • 169
2

In Swift:

self.view.insertSubview(newView, belowSubview: yourLabel)
Ali A. Jalil
  • 873
  • 11
  • 25