ユーザーが iPad を portate ではなく横向きモードにしたときに、高さのサイズを変更する方法を知りたい
このコードはポートレートで機能しますが、ランドスケープでも正しく機能させるにはどうすればよいですか。Google 検索や他のブログを試しましたが、すべて失敗しました。
- (void) viewDidLoad
{
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 - 60;
[bannerView_ setCenter:CGPointMake(screenXPos, screenYPos)];
bannerView_.rootViewController = self;
[self.view addSubview:bannerView_];
// Initiate a generic request to load it with an ad.
GADRequest *request = [GADRequest request];
// remove this line when you are ready to deploy for real
[bannerView_ loadRequest:request];
[super viewDidLoad];
}