size-classes

iOS 8 size classes for iPad landscape [duplicate]

被刻印的时光 ゝ 提交于 2020-01-11 17:12:50
问题 This question already has answers here : Sizing class for iPad portrait and Landscape Modes (6 answers) Closed 4 years ago . It seems all the current iOS devices maps to the new iOS 8 size classes nicely except iPad landscape? I seem not able to figure out how to use the size class feature to draw a different scene for iPad landscape (different from iPad portrait)? Is that intended by design in Apple's mind or am I miss something about the iOS size classes? 回答1: It appears to be Apple's

Distinguish iPad orientation with size classes

北战南征 提交于 2020-01-11 09:17:17
问题 With iOS 8 Apple introduced size classes for handling layouts of an app. Instead of designing user interfaces dependent on device, screen size, and orientation, developers are encouraged to rather adapt their app's layout depending on the active size classes. That's a good move, I think. However, when it comes to the iPad there seem to be no way to distinguish the different device orientations (which provide quite different screen space and handling in my opinion). From the Human Interface

iOS Universal app seems slightly zoomed in on phone

耗尽温柔 提交于 2019-12-30 19:52:52
问题 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. Here are screenshots of my apps bars, vs the Photos app in the iPhone 6 simulator to show what I'm talking

iOS Universal app seems slightly zoomed in on phone

血红的双手。 提交于 2019-12-30 19:50:31
问题 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. Here are screenshots of my apps bars, vs the Photos app in the iPhone 6 simulator to show what I'm talking

iOS 8 Autolayout with Size Classes

 ̄綄美尐妖づ 提交于 2019-12-25 14:58:10
问题 This is driving me crazy. All I need is to align the subview to superview & fill its bounds. To do this, all I used to do is create 4 Autolayout constraints for subview in storyboard and set top, left, bottom, right margins to 0 relative to subview. But in Xcode 6, with Size classes enabled, the left and right margins default to -16 and setting them to 0 has no effect. No matter what I do, the subview never fills superview bounds and there are few pixel gaps on the left and right. How do I

Swift - Make layout smaller for one device

寵の児 提交于 2019-12-25 09:34:07
问题 So I don't get the point to develop for 3,5 devices if the layout view is bigger than that, now some of the layouts doesn't fit in the 3.5 devices, what is the best way to solve it, I am already using Size Classes and Auto Layout. Is there any way to make things smaller just for the 3,5? 回答1: You can check @HAS answer for a great extension to get the device. You can simply add his extension to any file you want (outside of the class body). Then you check your device type like that: let model

UIViewController selective Autorotation with Size classes

蓝咒 提交于 2019-12-25 00:05:26
问题 The new size classes based Autorotation is a pain if you want custom behavior. Here are my requirements and flow: View Controller 1(VC1) modally presents View Controller 2 (VC2) VC1 only supports landscape, portrait, or both depending on user settings (achieved via supportedInterfaceOrientations ). For this example, we assume it is locked to landscape, VC 2 supports both landscape & portrait I use Size classes and in View Controller 1, I check for statusBarOrientation in viewWillTransition

What is wrong with size classes?

蓝咒 提交于 2019-12-24 07:39:02
问题 I have created a new project. And set a UILabel into two position depending on size classes, but wCompact, hAny can not trigger in iPhone simulator. I have set label x position to 0, but it is still on 15px as on wAny, hAny . Why? Use Size Classes is set. I am using Xcode beta 3. 回答1: I forget to set constrains. Set size-classes have nothing to do with view's position, to position views needs only to set up constrains. 回答2: You have missed to set the margin. I faced this issue in Xcode 6 .

Proportional layout for iPhones (from 5 to 6 Plus) with Size Classes

血红的双手。 提交于 2019-12-24 01:02:06
问题 I have passed through a number of tutorials about Size Classes but still I cannot figure out one thing. iPhone 5, iPhone 6 and iPhone 6 Plus have absolutely the same screen aspect ratios, so I want them to use the same content layout. By saying the same I mean proportional to width and height of the screen. But! I cannot find a way to make it proportional for all iPhones! There are just a few constraints that truly support proportions: "Aspect Ratio", "Same Width" + "Multiplier", "Same Height

Can a viewcontroller presented modally over current context (UIModalPresentationStyleOverCurrentContext) be rotated with device?

此生再无相见时 提交于 2019-12-23 01:19:13
问题 I have a controller which should be rotated with interface (device) orientation change. I track orientation changes, however i'm unable to rotate the view with the device orintation changes. I can animate the views inside, and switch their constraints etc, but i'd like to use Size classes for that. When i switch to UIModalPresentationStyleCurrentContext on presenting the controller it works, but messes with my navigation and tabbar, and i would like to do it this way. Can it be done this way?