廣告顯示iOS組件:JTCAdVaseViewController
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);
}

本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!