tags:

views:

989

answers:

1

How to set the UIImageView's layer position relative to sibling views?

I mean like the swapDepths() / setChildIndex() in flash

many thanks for reading

+2  A: 

It would be useful to describe what you are attempting in absolute terms, not by referring to another framework people may not be familiar with (particularly since "Layer" has its own special meaning in Cocoa.

If by "layer" you mean its position relative to sibling views then you can use the following functions.

bringSubviewToFront
sendSubviewToBack
exchangeSubviewAtIndex

Note that these are called on the PARENT of the UIView / UIImageView you wish to reposition. E.g. this would bring the imageview infront of its siblings;

[imageView.superview bringSubviewToFront: imageView];
Andrew Grant
thx so much! Sorry since I don't really know the absolute term for this one, so the best I can do will be referring to the same thing of another framework. If I don't refer to that ppl will be even more confused :p Anyway many thanks for your answer!
Unreality