I have a UIView that i create with a XIB. I then want to add it on top of a parent, take up the whole screen but use the safe area i have set up constraints for in the xib.
I can add the view fine, but when i do, the safe area is ignored, and the view goes all the way to the top and bottom.
The code i use (objective-c still sorry):
In the Xib, i have the top and bottom constrained to SafeArea.top and bottom. It looks fine in the layout there.
Any tips are appreciated.
I can add the view fine, but when i do, the safe area is ignored, and the view goes all the way to the top and bottom.
The code i use (objective-c still sorry):
Code Block (UIView *parent) MyViewController *newViewController = [[MyViewController alloc] initWithNibName:MY_VIEW_NIB_NAME bundle:nil]; [view setFrame:CGRectMake(0, 0, parent.bounds.size.width, parent.bounds.size.height)]; [parent addSubview:self.view];
In the Xib, i have the top and bottom constrained to SafeArea.top and bottom. It looks fine in the layout there.
Any tips are appreciated.