Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.77 KB | None | 0 0
  1. -(void)displayAdmobAd
  2. {
  3.  
  4.     iSitesNavigationController *controller=(iSitesNavigationController *)self.navigationController ;
  5.    
  6.     BOOL isLandScape=[[(iSitesNavigationController *)self.navigationController appDelegate] isDeviceInLandScapeMode];
  7.    
  8.     if(!isLandScape)
  9.     {
  10.         // get the view frame
  11.         CGRect frame = self.view.frame;
  12.        
  13.         UIView *adMobAd=[(iSitesNavigationController *)self.navigationController adMobAd];
  14.        
  15.         self.isAdBannerAvailable=YES;
  16.        
  17.         // put the ad at the bottom of the screen
  18.         [adMobAd setFrame:CGRectMake(0, frame.size.height - 50, frame.size.width, 50)];
  19.        
  20.         [adMobAd setTag:ADMOB_VIEW_TAG];
  21.        
  22.         [self.view addSubview:adMobAd];
  23.        
  24.         self.webView.frame=CGRectMake(0, 0, self.webView.frame.size.width, self.view.frame.size.height-50);
  25.     }
  26.    
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement