本文介绍了如何使用确切的框架和展示位置ID启动revmob横幅广告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我尝试使用RevMob中建议的代码显示具有特定展示位置ID的横幅广告但未成功,尝试此代码: RevMobAds * revmob = [RevMobAds revMobAds]; RevMobBanner * banner = [revmob bannerWithPlacementId:@ID_FROM_REV_MOB]; [banner showAd]; 尝试添加以下语句 if(IS_iPad){ banner.frame = CGRectMake(0,958,768,66); } else if(IS_WIDESCREEN){ banner.frame = CGRectMake(0,518,320,50); } else { banner.frame = CGRectMake(0,430,320,50); } 但没有成功,我能够展示横幅广告的唯一方法是这样的: [RevMobAds showBannerAdWithFrame:CGRectMake(0,958,768,66)withDelegate:自]; 但添加展示位置ID无效。 解决方案 我认为你需要使用RevMobBannwerView,而不是做如下所示: RevMobAds * revmob = [RevMobAds revMobAds]; RevMobBannerView * revBannerView = [revmob bannerViewWithPlacementId:@ID_FROM_REV_MOB]; if(IS_iPad){ revBannerView.frame = CGRectMake(0,958,768,66); } else if(IS_WIDESCREEN){ revBannerView.frame = CGRectMake(0,518,320,50); } else { revBannerView.frame = CGRectMake(0,430,320,50); } [revBannerView loadAd]; [self.view addSubview:revBannerView]; [self.view bringSubviewToFront:revBannerView]; I tried using the suggested code from RevMob to show a banner ad with a specific placement ID without success, tried this code:RevMobAds *revmob = [RevMobAds revMobAds]; RevMobBanner *banner = [revmob bannerWithPlacementId:@"ID_FROM_REV_MOB"]; [banner showAd];Tried even to add the following statementif (IS_iPad) { banner.frame = CGRectMake(0, 958, 768, 66); } else if (IS_WIDESCREEN){ banner.frame = CGRectMake(0, 518, 320, 50); } else { banner.frame = CGRectMake(0, 430, 320, 50); }but no success, the only way I could be able to show banner ads was this:[RevMobAds showBannerAdWithFrame:CGRectMake(0, 958, 768, 66) withDelegate:self];But it didn't help to add the placement ID. 解决方案 I think you need to do it as the following by using the RevMobBannwerView instead:RevMobAds *revmob = [RevMobAds revMobAds]; RevMobBannerView *revBannerView = [revmob bannerViewWithPlacementId:@"ID_FROM_REV_MOB"]; if (IS_iPad) { revBannerView.frame = CGRectMake(0, 958, 768, 66); } else if (IS_WIDESCREEN){ revBannerView.frame = CGRectMake(0, 518, 320, 50); } else { revBannerView.frame = CGRectMake(0, 430, 320, 50); } [revBannerView loadAd]; [self.view addSubview:revBannerView]; [self.view bringSubviewToFront:revBannerView]; 这篇关于如何使用确切的框架和展示位置ID启动revmob横幅广告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-27 16:36