Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to addSubview to the bottom of view hierarchy

I want to add mapView, which I'm adding programatically, to the bottom of hierarchy view, as I already draw some of the elements beforehand, in the storyboard.

So, after i call method:

[self.view addSubview:self.map];

How do I put it on the bottom of the view hierarchy ?!

like image 774
SteBra Avatar asked Jan 26 '15 13:01

SteBra


2 Answers

Just put it there directly instead.

[self.view insertSubview:_map atIndex:0];
like image 113
Robert Gummesson Avatar answered Sep 20 '22 03:09

Robert Gummesson


"This method moves the specified view to the beginning of the array of views in the subviews property."

[self.view sendSubviewToBack:yourView];
like image 23
rcat24 Avatar answered Sep 23 '22 03:09

rcat24