简体   繁体   中英

iOS Persist view layer value?

I have an application where a user can drag many images onto a canvas. Some views are above other views. I want to save the images transforms, frames, and z-index. Where do I find the z-index of a view (in comparison with other views on the superview) so I can persist it. And then how to I restore all subviews to their proper z-index?

The superview have an array of child, into which the child are in order from back 0 to top (number of child) and there is method to insert child at a certain index.

There is a section of method in the UIView documentation with method that look like this one:

- (void)insertSubview:(UIView *)view atIndex:(NSInteger)index

看起来你正在寻找视图层的(set / get) zPosition

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM