Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

addSubview beneath another UIView

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.

like image 987
Josh Kahane Avatar asked Nov 15 '12 17:11

Josh Kahane


3 Answers

In Swift:

self.view.insertSubview(newView, belowSubview: yourLabel)
like image 97
Ali A. Jalil Avatar answered Nov 03 '22 11:11

Ali A. Jalil


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

like image 35
rdelmar Avatar answered Nov 03 '22 10:11

rdelmar


you can use :

[self.view insertSubview:topview belowSubview:buttomView];
like image 34
shannoga Avatar answered Nov 03 '22 09:11

shannoga