LoginSignup
3
1

More than 5 years have passed since last update.

テザリング時にスプラッシュ画面を表示すると真ん中が抜ける問題

Last updated at Posted at 2018-03-27

 はじめに

テザリング時にロゴなどが表示されるスプラッシュ画面を起動すると真中部分が抜けてしまう問題があった
screenshot.png

どうやら別のアプリでもよく起こっている問題らしい
OS: Launch image gets wrinkled in the center during a call/recording/hot-spot session

基本情報

Xcode9.2
Swift4
会社のアプリのスプラッシュ画面の設定方法はLaunchScreen.storyboardを作ってそこにロゴをConstraintsを張って設定している。
screenshot.png

対策

アプリの起動時スプラッシュ画面を表示する時にステータスバーを非表示に設定する

TARGETS->Infoタブ内->Custom iOS Target Properties
Status bar is initially hiddenYESに設定
screenshot.png

AppDelegate.swift内に以下を記述

application:didFinishLaunchingWithOptions:- アプリケーションが画面を表示する直前に実行する、最後の初期化処理を記述するところでステータスバーを表示するように設定する

func application(_application:UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 
      application.isStatusBarHidden = false
      return true 
}

ちなみに最初の遷移先のViewControllerに下記をViewDidLoad()内にかいても良さそうだがiOS9以降deprecatedだった

override func viewDidLoad() {
        super.viewDidLoad()
                UIApplication.sharedApplication().setStatusBarHidden(true, withAnimation: .Slide)
}

参考文献

Hide statusbar during splash screen
Hide status bar on launch image

おまけ

テザリングのことPersonal Hotspot Activeって言うんですね

3
1
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
3
1