我有一个 iPad 应用程序,我正在将其转换为通用应用程序以在手机上显示.它有一个标签栏和一个导航栏,我的问题是它们在手机上都太大了.我可以发誓我听说过 Paul Hegarty(来自斯坦福大学的 iTunes U Swift 应用程序开发课程)提到某个地方的开关或技巧会导致酒吧适应 iPhone,但我找不到它.
I have an iPad app that I'm converting to a universal app to show on phones. It has both a tab bar and a navigation bar, and my problem is that they are both way too big on the phone. I could swear I heard Paul Hegarty (from the iTunes U class from Stanford on Swift app development) mention a switch or trick somewhere that would cause the bars to adapt to the iPhone, but I can't find it.
这是我的应用程序栏的屏幕截图,与 iPhone 6 模拟器中的照片应用程序对比,以显示我在说什么.
Here are screenshots of my apps bars, vs the Photos app in the iPhone 6 simulator to show what I'm talking about.
差别不大,但在小手机屏幕上意义重大.
Not a huge difference, but significant on a small phone screen.
我的字体也太大了,这令人困惑,因为我将它们设置为所有尺寸类别的系统标题"或正文"选项,但这可能是一个单独的问题.
My fonts are also way to big, which is confusing since I have them set to the system "headline" or "body" options for all size classes, but that may be a separate issue.
非常感谢任何帮助!
用 Swift 编写的应用程序,使用 iOS8 的故事板,顺便说一句.
App written in Swift, using storyboards for iOS8, btw.
我看这个越多,我越相信它与栏无关,而是与整个应用程序有关 - 字体和所有内容.整个应用似乎被放大到了 120%,这很微妙,但看起来真的很糟糕,而且浪费空间.
The more I look at this, the more I'm convinced it's not related to the bars, but the entire app - the fonts and everything. The whole app appears to be zoomed in to 120%, which is subtle, but looks really bad and wastes space.
我现在在第二个应用程序中也看到了这一点 - Apple DateCell 示例.在 iPhone 6 模拟器上运行时,它也会显示为放大".
I have also now seen this in a second app - the Apple DateCell sample. It also appears 'zoomed in' when run on the iPhone 6 simulator.
编辑 2:这种效果在 iPhone 6 Plus 模拟器上更加夸张——一切都更加放大"了——顶部和底部的条几乎是它们应有的高度的两倍.这可以通过下载 Apple DateCell 示例并运行它来查看.
Edit 2: This effect is even more exaggerated on the iPhone 6 Plus simulator - everything is even more 'zoomed in' looking - the top and bottom bars are almost twice the height they should be. This can be seen by downloading the Apple DateCell sample and running it.
编辑 3:ARGGGG,所有这些时间都浪费了,这是由于启动屏幕图像 - 为什么没有设置启动屏幕图像会导致整个应用程序缩放?
Edit 3: ARGGGG, all this time wasted, and it was due to the launch screen image - why on earth would a launch screen image not being set cause the entire app to scale?
我终于明白了——它与启动屏幕图像有关.显然,如果设置不正确,整个应用程序会因某种原因在 iPhone 6 和 6 Plus 上进行缩放.这个问题是我找到答案的原因.
I finally figured this out - it was related to the launch screen image. Apparently if it's not setup right, the whole app scales on the iPhone 6 and 6 Plus for some reason. This question is what pointed me to the answer.
对我来说,我必须在 Assets 中创建一个 LaunchScreen 图像,并将其设置在项目文件中,并且还要选择 launchScreen.xib 作为项目中的启动屏幕文件.我还没有真正的启动屏幕,所以在我的情况下,这些都是空的或默认值.
For me, I had to both create a LaunchScreen image in Assets, and set it in the project file, and ALSO select the launchScreen.xib as the Launch Screen File in the project. I don't have a real launch screen yet, so these are both just empty or defaults in my case.
这篇关于iOS 通用应用程序似乎在手机上略微放大的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!