广告显示iOS组件:JTCAdVaseViewController
jopen
12年前
JTCAdVaseViewController 是一个用来自动添加来自 iAD 和 ADMob 广告信息的控件,使用 AddedChildView 处理,可根据广告大小自动调整视图。
用法:
- 创建JTCAdBaseViewController的子类
- 在 viewDidLoad, 添加你的viewController 作为 mainViewController
- 设置选项目
#import "JTCAdBaseViewController.h" @interface TNCAdBaseViewController : JTCAdBaseViewController @end
- (void)viewDidLoad { self.mainViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"mainViewController"]; //self.adLocation = JTCAdBaseViewAdLocationTop; self.adLocation = JTCAdBaseViewAdLocationBottom; self.GADBannerViewPublisherID = @"put your Publisher ID"; // if user purchase ad, you simply put self.isAdRemoved = YES; and Ads doesn't show. self.isAdRemoved = NO; // if you prefer admob first, put JTCAdBaseViewAdPriorityAdMob self.adPriority = JTCAdBaseViewAdPriority_iAd; // self.adPriority = JTCAdBaseViewAdPriorityAdMob; [super viewDidLoad]; // Do any additional setup after loading the view. } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (YES); }