简体   繁体   中英

Storyboard systemVersion 3.0 behave like iPhone on iPad mini(7.9 inch) but not on iPad2(9.7 inch)

I am using Xcode 6.1 with OS X Yosemite , I am facing a problem related to Storyboard. The storyboard is behave like iPhone on iPad mini but work as expected with iPad2 , this problem is only with Storyboard with systemVersion 3.0 but not on it's lower version like version 2.0.

Below is my iPad mini screenshot ( I don't want storyboard to behave like this ) 在此处输入图片说明

and here is my iPad2 9.7 inch ( I want this behaviour for iPad mini too ) 在此处输入图片说明

I want to make this app only for iPad so my project configuration is like this 在此处输入图片说明

but when I change it's configuration Device iPad to Universal it works as expected in both iPad mini and iPad2 . But I don't want to deploy on iPhone.

在此处输入图片说明

Here is my Storyboard systemVersion 3.0 as viewed source code 在此处输入图片说明

and when I make change in storyboard's XML systemVersion to 2.0 and targetRuntime to iOS.CocoaTouch.iPad it's again work as expected in both iPad mini and iPad2 , but there is again a problem when ever I make some little changes in storyboard like move one pixel a label or button or any object Xcode will update it's systemVersion back to 3.0 and targetRuntime to iOS.CocoaTouch which will cause storyboard work again as iPhone on iPad mini. 在此处输入图片说明

I don't found any solution over interNet and my self too.

You can use Size Classes with iOS versions earlier than iOS 8. The Apple documentation states :

Deploying an App With Size Classes on Earlier iOS Versions

For apps supporting versions of iOS earlier than iOS 8, most size classes are backward compatible.

Size classes are backward compatible when:

  • The app is built using Xcode version 6 or later
  • The deployment target of the app is earlier than iOS 8
  • Size classes are specified in a storyboard or xib
  • The value of the height component is not compact

Storyboard XML content shouldn't be edited directly. That isn't going to solve any of your problems in a reliable fashion, particularly not if you start altering version numbering so that the actual generated storyboard content is a different version to what it appears to be from the header.

It sounds like what you've encountered may be a bug in the way size classes are converted to be backwards compatible, though what is missing from your question to give more information is how you've actually configured your size classes.

您不能在iOS7上使用size类,因为size class的概念是在iOS 8中引入的。因此,从情节提要中删除此size类将对您有效。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM