PushViewController causing autorun issue with hidesBottomBarWhenPushed (iphone6)

I have FirstViewController

with TabBarController

and NavigationController

(TabBarController> NavigationController> UIViewController)

When you click UIButton

on FirstViewController

, he presses on SecondViewController

.

SecondViewController *vc2 = [self.storyboard instantiateViewControllerWithIdentifier:@"BVC"];

vc2.hidesBottomBarWhenPushed = YES;

[self.navigationController pushViewController:vc2 animated:YES];

      

In SecondViewController

the lower right corner there is UILabel

with restrictions - (Width-Equal, Height-Equal, TrailingSpaceToSuperView = 16, BottomSpaceToBottomLayoutGuide = 20)

The result works fine on iphone4s (IOS7), but on iphone6 ​​(IOS8.1) it will first appear UILabel

in the lower right corner plus the "BottomBar" height for about 1 second and then update to the correct place (BottomSpaceToBottomLayoutGuide = 20)

When I set the pushViewController

animated NO, it UILabel

will display in the right place immediately.

[self.navigationController pushViewController:vc2 animated:NO];

      

Does anyone face the same problem?

+3


source to share


2 answers


I have solved this problem. Select the bottom of the BottomSpaceToBottomLayoutGuide constraint.



enter image description here

+6


source


@ Jenny's approach is now hidden in Xcode 7, but you can open the storyboard as source, find this constraint and manually set it to "bottom". To make it easier to find, just copy its ObjectID from the Identity Index.



0


source







All Articles