当广告加载时,candisplaybannerads会在屏幕上晃动

时间:2015-06-10 01:18:07

标签: ios objective-c iad candisplaybannerads

我在这看到了一些帖子,但似乎都没有回答我的问题......

我的视图底部有一个菜单限制在底部布局指南中,以便在使用

加载广告时
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]];

0 个答案:

没有答案