0

so I have an application with several images, buttons, etc.. Now, I would like to control programmatically which object is in the foreground and which is further in the back. I know that in the storyboard this is possible, but since I declare a button in the AppDelegate (I don't have in the storyboard) I can't use this function.

Now, is there a way to do this?

LinusGeffarth
  • 27,197
  • 29
  • 120
  • 174
  • 1
    Check this:[How to set iPhone UI View z index](http://stackoverflow.com/questions/4631878/how-to-set-iphone-ui-view-z-index) – gabbler Oct 28 '14 at 02:58

2 Answers2

0

Look at the "Managing View Hierachy" section on UIView to accomplish this.

https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIView_Class/index.html#//apple_ref/doc/uid/TP40006816-CH3-SW46

You can bring views to the front or send them to the back or adjust their index among others.

- (void)bringSubviewToFront:(UIView *)view
Neonkoala
  • 392
  • 2
  • 5
0

You have to use the property .zPosition to accomplish that.

Ummsekatze
  • 26
  • 3