2016-05-08 41 views
1

這是從FB提供的代碼,但此廣告放置在頂部橫幅上,我希望它適合底部橫幅。是否有一個簡單的修復方法來更改FB廣告的位置?此外,實施工作正在進行,測試廣告正在運行。如何將Facebook Audience Network橫幅廣告移至底部而不是屏幕頂部?

-(void)viewDidLoad 
{ 
    [super viewDidLoad]; 

    FBAdView *adView = [[FBAdView alloc] initWithPlacementID:YOUR_PLACEMENT_ID 
         adSize:kFBAdSizeHeight50Banner 
         rootViewController:self]; 
    [adView loadAd]; 
    [self.view addSubview:adView]; 
} 

回答

1

你可以通過改變它的框架這樣的移動橫幅:

FBAdView *adView = [[FBAdView alloc] initWithPlacementID:YOUR_PLACEMENT_ID 
         adSize:kFBAdSizeHeight50Banner 
         rootViewController:self]; 

adView.frame = CGRectMake(0, self.view.frame.size.height-adView.frame.size.height, adView.frame.size.width, adView.frame.size.height); 
[adView loadAd]; 
[self.view addSubview:adView]; 
相關問題