LoginSignup
0
0

More than 5 years have passed since last update.

[Swift] iAdバナーが画面からはみ出る問題

Posted at

ステータスバーを表示しViewContollerの範囲をステータスバー以下に設定すると、

swift
self.canDisplayBannerAds = true

この書き方ではバナーが画面からはみ出てしまった。
スクリーンショット 2015-08-10 18.35.26.png

対策として、以下のようにしたところ、正常に表示された。

swift
var iAdBanner = ADBannerView()
//画面下に配置
iAdBanner.frame.origin.y = UIScreen.mainScreen().applicationFrame.height - iAdBanner.frame.height    
//バナー表示前に表示される背景の色を指定
iAdBanner.backgroundColor = UIColor.blackColor()
self.view.addSubview(iAdBanner)
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0