有關 Devices 設定:從 iPhone 換成 Universal 會有什麼問題?

Toby Hsu
Toby Hsu
Jul 21, 2017 · 3 min read

如果今天做了一隻 App 並在專案設定裡面選擇 iPhone,你仍然可以把這個 App build 到 iPad之上,只是顯示上會在右下角多了一個 X1 or X2 的按鈕。
顯然地,Apple 並不希望開發者這樣做,因為他至今仍維持著3.5吋的畫面大小,感覺不到想改成4吋大小的意思,而自從AutoLayout出世之後,就稍微解決了一些 Device size 破碎化的問題。

好AutoLayout,不用嗎?

結果有一天⋯⋯
腦闆:誒誒,我們現在的 App 可以也支援 iPad 使用嗎?
你:可以啊,但是為了提供更好的使用者體驗通常把 iphone app 跟 ipad app 的介面設計做一些調整 (被斷法)
腦闆:那就改成兩種裝置都能下載吧!(走掉)
你:(´・ω・`)

嗯哼,所以使用 AutoLayout 的你一定知道,不做介面區分的話只要把專案設定裡的 Devices 設定成 Universal就好了。

沒有綽辣!如果真的有這麼順利就不用多這篇文章了RRRRRRRR

的確,當你修改成 Universal 時就可以通吃 iPhone 與 iPad 了。但是後續的問題是到上傳到 iTunes Connect 時才會發生!接下來我們會用他的錯誤代碼 90474 為大家說明這些問題該怎麼解決。

從系統提示的資訊去 Google 其實就可以得到答案了,簡單的說就是在 info.plist 上把原本只有 Supported interface orientations 的設定,改成 Supported interface orientations (iPhone) 跟 Supported interface orientations (iPad) 這兩個,再設定你要支援的裝置旋轉方向即可。

最後還有一個步驟,就是要到 Project General 那邊找一個 Requires full screen 把它打勾,不然你直接再上傳一次還是會失敗

哎,有些問題還真的是要上傳了才出現一些要注意的咩咩嘎嘎 ⋯⋯ (´・ω・`)
雖然是很小的問題還是做個筆記吧!

參考資料:

)
Toby Hsu

Written by

Toby Hsu

tvOS/iOS engineer at CATCHPLAY. Also interested in user research. https://www.linkedin.com/in/tobyhsu/

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade