You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Xcode8, size of any UIView loaded from xib has changed to be (1000, 1000). So if I load a single UINavigationBar(not from UINavigationController) from xib, its height will be 1020, the view of UIViewController will be covered by the overlay, which is added by LTNavigationBar.
Solution: Auto layout should be used, don't use "self.overlay.autoresizingMask = UIViewAutoresizingFlexibleWidth;" Just like the following:
In Xcode8, size of any UIView loaded from xib has changed to be (1000, 1000). So if I load a single UINavigationBar(not from UINavigationController) from xib, its height will be 1020, the view of UIViewController will be covered by the overlay, which is added by LTNavigationBar.
Solution: Auto layout should be used, don't use "self.overlay.autoresizingMask = UIViewAutoresizingFlexibleWidth;" Just like the following:
// self.overlay.autoresizingMask = UIViewAutoresizingFlexibleWidth; // Comment out this line
self.overlay.translatesAutoresizingMaskIntoConstraints = NO;
[[self.subviews firstObject] insertSubview:self.overlay atIndex:0];
NSArray *hConstraints = [NSLayoutConstraint constraintsWithVisualFormat:@"H:|-(0)-[overlay]-(0)-|" options:0 metrics:nil views:@{@"overlay":self.overlay}];
NSArray *vConstraints = [NSLayoutConstraint constraintsWithVisualFormat:@"V:|-(-20)-[overlay]-(0)-|" options:0 metrics:nil views:@{@"overlay":self.overlay}];
[self.overlay.superview addConstraints:hConstraints];
[self.overlay.superview addConstraints:vConstraints];
The text was updated successfully, but these errors were encountered: