我看到了一些关于此的帖子,但似乎都没有回答我的问题......
我的视图底部有一个菜单,限制在底部布局指南中,这样当广告加载时使用
self.candisplaybannerads = true;
菜单也向上移动。在 iOS7 中,这种过渡是平滑的,并且菜单随着横幅向上滑动而向上滑动。但在 iOS8 中,菜单会弹出到新位置,然后横幅会平滑地向上滑动。有没有其他人经历过这个或知道如何解决它。谢谢
示例项目:https://github.com/jbestor/adTest(在示例项目中,iOS7 或 iOS8 都没有平滑地向上滑动)。
按钮菜单的约束:
//button1
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:_button1 attribute:NSLayoutAttributeTrailing
relatedBy:NSLayoutRelationEqual toItem:self.view
attribute:NSLayoutAttributeTrailing multiplier:1.0 constant:0.0]];
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:_button1 attribute:NSLayoutAttributeBottom
relatedBy:NSLayoutRelationEqual toItem:self.bottomLayoutGuide
attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0.0]];
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:_button1 attribute:NSLayoutAttributeWidth
relatedBy:NSLayoutRelationEqual toItem:nil
attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:50]];
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:_button1 attribute:NSLayoutAttributeHeight
relatedBy:NSLayoutRelationEqual toItem:nil
attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:50]];
//button2
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:_button2 attribute:NSLayoutAttributeLeading
relatedBy:NSLayoutRelationEqual toItem:self.view
attribute:NSLayoutAttributeLeading multiplier:1.0 constant:0.0]];
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:_button2 attribute:NSLayoutAttributeBottom
relatedBy:NSLayoutRelationEqual toItem:self.bottomLayoutGuide
attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0.0]];
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:_button2 attribute:NSLayoutAttributeWidth
relatedBy:NSLayoutRelationEqual toItem:nil
attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:50]];
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:_button2 attribute:NSLayoutAttributeHeight
relatedBy:NSLayoutRelationEqual toItem:nil
attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:50]];
//button3
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:_button3 attribute:NSLayoutAttributeLeading
relatedBy:NSLayoutRelationEqual toItem:self.view
attribute:NSLayoutAttributeLeading multiplier:1.0 constant:0.0]];
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:_button3 attribute:NSLayoutAttributeBottom
relatedBy:NSLayoutRelationEqual toItem:self.bottomLayoutGuide
attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0.0]];
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:_button3 attribute:NSLayoutAttributeWidth
relatedBy:NSLayoutRelationEqual toItem:nil
attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:self.view.frame.size.width]];
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:_button3 attribute:NSLayoutAttributeHeight
relatedBy:NSLayoutRelationEqual toItem:nil
attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:50]];