size-classes

How do I reset specific size class data on a storyboard in Xcode6?

帅比萌擦擦* 提交于 2019-12-04 03:46:19
I am using size classes to create a storyboard that can target all the various screen sizes and orientations. I have been working in the Any Width-Any Height size class. I ran into a display issue and decided to make those changes in the Compact Width - Regular Height size class. At a Later time, I was able to resolve my layout issue by making constraint changes to the Any Width-Any Height size class. How can I revert the changes made to the Compact Width - Regular Height size class so that the Any Width-Any Height size class will be used at runtime without manually reverting the changes? I

Changing the multiplier of a constraint based on size class

限于喜欢 提交于 2019-12-04 01:47:31
Is it possible to give a constraint a different multiplier depending on the current size class? I have a view that I want to be half the size of the screen for a regular size class width and I want it to be 80% of the size of the screen for a compact size class width. In the storyboard I have the option to add different variables for different size classes to the constraints constant value, but not it's multiplier value. It's an Equal Widths Constraint in case that is relevant. I haven't done much with adding constraints programatically so I'm hoping their might be a solution that lies down

Size class specifically for portrait 3.5 inch (iPhone 4S) Xcode 6?

三世轮回 提交于 2019-12-03 18:00:38
问题 I'm tuning my UI App, but I got an issue that I can't solve. As I can see Compact height affects all iPhones under 4.7 inches, but my UI is fine except for the iPhone 4S (3.5 inches). I don't want to modify the layout for all iPhones under 4.7 inches, just the iPhone 4S, at the same time I don't want to left out this device. There's any workaround so I can set the amendments but just and only for the 3.5 inches portrait? or should I say goodbye to 100 millions devices out there? I know it's a

Using size classes programmatically

六月ゝ 毕业季﹏ 提交于 2019-12-03 06:51:09
问题 I (hopefully) watched all the relevant WWDC2014 session videos and read the docs, so this question is mostly to confirm my suspicions, but please educate me. What I want to do is animate views using Auto Layout. That in itself is not a problem. But these animations' endpoints change with different orientations. I thought I might be able to use size classes to move the views automatically on rotation, but Apple's developer guide says that animations have to be done programmatically, and from

Use Size Classes in Xcode 6 beta

孤者浪人 提交于 2019-12-03 03:55:00
问题 Built a new project from scratch in Swift in Xcode 6 (Beta 1) and see File Inspector of Storyboard. There is Use Size Classes below Use Auto Layout . This is the screenshot of this. 1) What is Use Size Classes ? 2) Is it related with iPhone 6 screen size? 回答1: Size classes let's you create a single storyboard irrespective of the device. Brings the joy of adaptive layouts (layouts for different canvas sizes instead of specific device, could be compact or regular ) More generally a single app

Programmatically implementing two different layouts using size classes

爷,独闯天下 提交于 2019-12-03 03:01:00
问题 I have a four buttons layout. In portrait they should be shown one above the other. In landscape they should be in two columns each with two buttons. I implement the buttons in code - really simple stuff: UIButton *btn1 = [[UIButton alloc] init]; [self.view addSubview: btn1]; UIButton *btn2 = [[UIButton alloc] init]; [self.view addSubview: btn2]; UIButton *btn3 = [[UIButton alloc] init]; [self.view addSubview: btn3]; UIButton *btn4 = [[UIButton alloc] init]; [self.view addSubview: btn4];

Using size classes programmatically

穿精又带淫゛_ 提交于 2019-12-02 19:25:31
I (hopefully) watched all the relevant WWDC2014 session videos and read the docs, so this question is mostly to confirm my suspicions, but please educate me. What I want to do is animate views using Auto Layout. That in itself is not a problem. But these animations' endpoints change with different orientations. I thought I might be able to use size classes to move the views automatically on rotation, but Apple's developer guide says that animations have to be done programmatically, and from what I can gather, size classes are an Interface-Builder-only thing. Another idea I had was using custom

iOS 8 size classes for iPad landscape [duplicate]

眉间皱痕 提交于 2019-12-02 18:46:39
This question already has an answer here: Sizing class for iPad portrait and Landscape Modes 6 answers 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? RonDiamond It appears to be Apple's intent to treat both iPad orientations as the same -- but as a number of us are finding, there are very legitimate design

UIView autorotation issue

对着背影说爱祢 提交于 2019-12-02 17:56:53
问题 I am getting issues in autorotation of a UIView which is nothing but a red line of width 4 and height half of superview's height in landscape mode, and in portrait mode the height is 4 points and width is half of superview width. You can see the issue in the gif. As I rotate from landscape to portrait, the effect of autorotation is not smooth and with distortions. Here is the code. What am I doing wrong? private var myView:UIView! override func viewDidLoad() { super.viewDidLoad() // Do any

Programmatically implementing two different layouts using size classes

天涯浪子 提交于 2019-12-02 16:34:38
I have a four buttons layout. In portrait they should be shown one above the other. In landscape they should be in two columns each with two buttons. I implement the buttons in code - really simple stuff: UIButton *btn1 = [[UIButton alloc] init]; [self.view addSubview: btn1]; UIButton *btn2 = [[UIButton alloc] init]; [self.view addSubview: btn2]; UIButton *btn3 = [[UIButton alloc] init]; [self.view addSubview: btn3]; UIButton *btn4 = [[UIButton alloc] init]; [self.view addSubview: btn4]; NSDictionary *views = NSDictionaryOfVariableBindings(btn1, btn2, btn3, btn4); [btn1