【发布时间】:2015-04-16 13:45:17
【问题描述】:
我有一组图片,比如 10 张图片。我想用动画一个接一个地在屏幕底部显示这些图像。
看起来像 iAd 或 ADBannerView 会随着动画显示并随着动画消失。
图片来自带有 URL 链接的服务器。我需要在屏幕底部像广告一样显示它们。
我用下面的代码
https://github.com/alobi/ALAlertBanner
但在某些情况下它不显示图像..(使用计时器或导航到其他屏幕并返回此视图时)
下面是我的代码
_secondsToShow = 10;
_showAnimationDuration = 5;
_hideAnimationDuration = 5;
self.bannerTimer = [NSTimer scheduledTimerWithTimeInterval:20.0 target:self selector:@selector(showAdvertisementsInView) userInfo:nil repeats:YES];
[self.bannerTimer fire];
- (void)showAdvertisementsInView {
appDelegateRef.imageIndex=appDelegateRef.imageIndex+1;
ALAlertBannerPosition position = ALAlertBannerPositionBottom;
//ALAlertBannerStyle randomStyle = (ALAlertBannerStyle)(arc4random_uniform(4));
banner = [ALAlertBanner alertBannerForView:self.view style:ALAlertBannerStyleSuccess position:position title:nil subtitle:nil tappedBlock:^(ALAlertBanner *alertBanner) {
NSLog(@"tapped!");
[alertBanner hide];
}];
banner.secondsToShow = self.secondsToShow;
banner.showAnimationDuration = self.showAnimationDuration;
banner.hideAnimationDuration = self.hideAnimationDuration;
[banner show];
}
那么,除了使用 iAd 或 AdMob 或 ALAlertBanner 来解决我的问题之外,还有其他解决方案吗?
在此先感谢...!
【问题讨论】:
标签: ios objective-c banner