0
我添加了放置在底部的admob廣告。問題是當我在UITableView中向下滾動時,admob並沒有停留在底部。它保持在它開始的地方。我怎樣才能做到這一點:Admob廣告不會貼在滾動底部
這是我的代碼:
GADBannerView *bannerView_ = [[GADBannerView alloc] initWithAdSize:kGADAdSizeSmartBannerPortrait];
bannerView_.adUnitID = @"adid";
bannerView_.rootViewController = self;
UIView *bannerView=[[UIView alloc]initWithFrame:CGRectMake(0,self.view.frame.size.height - bannerView_.frame.size.height, self.view.frame.size.width, bannerView_.frame.size.height)];
bannerView.autoresizingMask = UIViewAutoresizingFlexibleTopMargin;
[bannerView addSubview:bannerView_];
[self.view addSubview:bannerView];
[self.view bringSubviewToFront:bannerView];
[bannerView_ loadRequest:[GADRequest request]];
請不要在這裏顯示像adUnitID這樣的東西......關於你的問題,我假設self.view是scrollview,在這種情況下,將self.view更改爲普通視圖,在該視圖內添加scrollview,並將橫幅添加到self.view,以便它位於scrollview之外 – Jack