简体   繁体   中英

I don't fully understand sendSubviewToBack. Please, see the code

You can see my screenshot of xib's file.

在此输入图像描述

I do some manipulation in viewDidLoad

-(void) viewDidLoad
{
 [smallView removeFromSuperview];
 [bigView sendSubviewToBack:smallView];
}

Will the hierarchy change from view->bigView->smallView to view->smallView->bigView?

No the hierarchy will not be affected. The documentation says:

sendSubviewToBack:
Moves the specified subview so that it appears behind its siblings.

It changes the order of painting subviews. If you have two views which are overlapping and have the same superview then you will be able to define which of that two views should be in front.

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