Is there any way to add subview in the "bottom" of its view,like z=0 when you use layers? I need this because when I spawn objects they need to be under another pictures,not above.
The subviews of a UIView are sorted in a way that the last one of the array is the frontmost one, and then the first one (index 0) is the one in the back. So, to insert it in the "bottom", it's sufficent to do like this:
[view insertSubview:aView atIndex:0]
Sure thing--just add the new view and use the sendSubviewToBack: method of the container view.
sendSubviewToBack:
Moves the specified subview so that it appears behind its siblings.
- (void)sendSubviewToBack:(UIView *)view
source: http://developer.apple.com/library/IOs/#documentation/UIKit/Reference/UIView_Class/UIView/UIView.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With