7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

hidesBottomBarWhenPushed=trueした後に遷移すると一瞬余白がでてしまう問題

Last updated at Posted at 2017-07-30

問題

tabbarを消して画面遷移したいとき、以下のように書くことがある

viewController.hidesBottomBarWhenPushed = true
show(viewController, sender: self)

この方法で遷移すると、遷移中に一瞬tabbar分の高さの余白が見えてしまうことがある。

解決方法

結論から言うと、遷移先の画面のautolayoutの設定の問題の可能性が高い。

問題が発生する制約

下の制約に、 Vertical Spacing to Bottom Layout Guide を使用していた。
スクリーンショット 2017-07-31 2.22.41.png

問題が発生しない制約

上の画像に表示されているポップアップが出ている状態で、Altを押し続けると Bottom Space to Container Margin という選択肢が現れるので、それを使用する。

参考

constrain view.bottom to superview.bottom not bottomLayoutGuide in storyboard

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?