Xcode使iad粘到屏幕底部
问题描述:
我怎样才能让iad的横幅总是在屏幕的底部,用户可以上下滚动,但添加将始终存在(屏幕底部)。这是我的代码,我使用的IAD:Xcode使iad粘到屏幕底部
ViewController.h
@interface ViewController : UIViewController <ADBannerViewDelegate>
ViewController.m
// Method is called when the iAd is loaded.
-(void)bannerViewDidLoadAd:(ADBannerView *)banner {
// Creates animation.
[UIView beginAnimations:nil context:nil];
// Sets the duration of the animation to 1.
[UIView setAnimationDuration:1];
// Sets the alpha to 1.
[banner setAlpha:1];
// Performs animation.
[UIView commitAnimations];
}
// Method is called when the iAd fails to load.
-(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error {
// Creates animation.
[UIView beginAnimations:nil context:nil];
// Sets the duration of the animation to 1.
[UIView setAnimationDuration:1];
// Sets the alpha to 0.
[banner setAlpha:0];
// Performs animation.
[UIView commitAnimations];
}
答
添加到您的AppDelegate中的窗口,并把上述所有的意见那个横幅。即降低所有ViewController的横幅高度的高度。
我在开发我的一个应用程序时为这个特定问题实施了一个整洁的解决方案。如果您想通过https://www.codementor.io/francesco与我联系,我很乐意为您提供帮助。 – singingAtom 2014-09-22 21:34:44