Programmatically send front / back elements created from an interface builder

There are layout options in the interface designer for sending back or sending to the forefront any elements such as UIButton , UIImage , UILabel , etc.

Now, I would like to do the same at runtime, programmatically.

Is there an easy way to do this?

I do not want to create different views, just updating the z-axis.

+80
cocoa-touch interface-builder z-axis
Jun 28 '09 at 13:27
source share
2 answers

There are several UIView methods that allow you to change the hierarchy of views.

Since your views are already inserted into your supervisor, you can easily call bringSubviewToFront: once for each view in any order.

+185
Jun 28 '09 at 13:34
source share

You can use:

 [self.view bringSubviewToFront:myButton]; 
+42
Aug 29 '10 at 17:18
source share



All Articles