0
我在我的應用程序中使用Admob中介,基本上,該視圖在頂部爲橫幅預留了空間。Admob只在iPad上推下視圖,我該如何阻止它?
因此,我的代碼允許在iPad和iPhone上告知橫幅去哪兒。
它可以在我的iPhone上完美工作,奇怪的是,這適用於iPad和iPhone上的許多其他應用程序,但出於某種原因,在這一個上,僅適用於iPad,它會在頂部創建額外的部件屏幕,而不是橫幅在頂部,它的橫幅,然後是一個小的差距,說30像素(大約),這推動屏幕下來,看起來很可怕!
這是用來調用的代碼,任何想法?如果我刪除該橫幅視圖的iPad部分,則視圖加載正常,所以它必須是該代碼中的某些內容。
- (void)viewDidLoad{
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
bannerView_ = [[GADBannerView alloc] initWithAdSize:kGADAdSizeSmartBannerPortrait];
bannerView_.adUnitID = MY_BANNER_UNIT_ID;
CGRect screenRect = [[UIScreen mainScreen] bounds];
CGFloat screenWidth = screenRect.size.width;
CGFloat screenHeight = screenRect.size.height;
CGFloat screenXPos = (screenWidth /2);
CGFloat screenYPos = screenHeight - 980;
[bannerView_ setCenter:CGPointMake(screenXPos, screenYPos)];
bannerView_.rootViewController = self;
bannerView_.adUnitID = MY_BANNER_UNIT_ID;
bannerView_.rootViewController = self;
[self.view addSubview:bannerView_];
}else{
bannerView_ = [[GADBannerView alloc] initWithAdSize:kGADAdSizeSmartBannerPortrait];
bannerView_.adUnitID = MY_BANNER_UNIT_ID;
CGRect screenRect = [[UIScreen mainScreen] bounds];
CGFloat screenWidth = screenRect.size.width;
CGFloat screenHeight = screenRect.size.height;
CGFloat screenXPos = (screenWidth /2);
CGFloat screenYPos = screenHeight - 455;
[bannerView_ setCenter:CGPointMake(screenXPos, screenYPos)];
bannerView_.rootViewController = self;
bannerView_.adUnitID = MY_BANNER_UNIT_ID;
bannerView_.rootViewController = self;
[self.view addSubview:bannerView_];
[super viewDidLoad];
self.navigationController.navigationBarHidden=YES;
isCharging = FALSE;
isFull = FALSE;
count =0;
}
}