Anyone know how to programmatically set the z order of UIImageViews? The order of instancing them will bring the last one instanced closest to the screen front, but how can it be changed at runtime?
Thanks // :)
UIImage contains the data for an image. UIImageView is a custom view meant to display the UIImage . Save this answer.
A view that displays a single image or a sequence of animated images in your interface.
An object that manages image-based content and allows you to perform animations on that content.
The zIndex() modifier helps to control the display order of overlapping views. It takes a value parameter that represents the relative front-to-back ordering for a view and the default value is 0. This implies, a view with a greater zIndex value would be displayed on top of views with lesser zIndex value.
You can use the following if the UIImageView
is already a subview:
bringSubviewToFront
sendSubviewToBack
or any of the following if you're inserting the UIImageView
as a subview:
insertSubview:atIndex
insertSubview:aboveSubview
insertSubview:belowSubview
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