旋轉螢幕時 tabBar layout 跑掉

Zhi-Hong Lin
1 min readOct 2, 2019

問題情境:

VC1 = 有tabBar VC

VC2 = 沒有tabBar VC

VC1 push 到 VC2,VC2旋轉成橫屏,返回到 VC1 時強制轉向成豎屏,這時 VC1 的 tabBar layout 在 iphone 5s 以及 iphone X 以上裝置會跑掉,如下圖

解法1:自己設定 tabbar 的 frame

解法2:

隱藏 tabBar 不透過 hideBarBottomWhenPush = true 來設定

而是用 tabBar.isHidden = true 來實現

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

Write a response