Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
483 views
in Technique[技术] by (71.8m points)

iphone - Size Classes in iOS 7

I created a new app in Xcode 6 using Size Classes. After testing with iOS 7, I can't figure out how to get iPhone to display a certain size class while in landscape mode.

I first developed the UI with iPhone landscape as wAny hCompact, but iOS 7 doesn't recognize that. I had iPhone portrait in wAny hAny.

I then changed it so now I'm using wCompact hRegular for iPhone portrait. I then modified wAny hAny to be the landscape layout. But it's not using that layout when the iOS 7 device is in landscape.

Is iOS 7 able to use different size classes based on the device being portrait or landscape? If so, which size class should I be using?

Reference: Really helpful information about backwards compatibility with size classes.

ps. I'm not concerned with iPad because the device does not display a different size class based on the device rotation in iOS 8.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Size classes works in iOS 7 for sure. But only if you follow several rules:

  • 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 file
  • The value of the height component is not compact (yep, this is your case, it's not possible in iOS 7, unfortunatelly)

There is a little explanation here: https://stackoverflow.com/a/24976792/2190175


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...