Questions tagged [ios-autolayout]

In iOS, Auto Layout dynamically calculates the size and position of all the views in your view hierarchy, based on constraints placed on those views.

In iOS, Auto Layout dynamically calculates the size and position of all the views in your view hierarchy, based on constraints placed on those views.

More info

1049 questions
33
votes
4 answers

Collection View Compositional Layout with estimated height not working

I want my app to be optimized for every accessibility options including the text size. I made a collectionView layout based on sections with a compositional layout. So I need my cell's height to grow with it's content. I thought using…
Que20
  • 1,469
  • 2
  • 13
  • 27
33
votes
4 answers

How to set up different Auto Layout constraints for different screen sizes

I have a tableView with static cells. The cell contains an ImageView which fills it completely. And I have another smaller ImageViews atop. I position this ImageViews with constraints. I have a question about resizing the constraints. How can I set…
Vitya Shurapov
  • 2,200
  • 2
  • 27
  • 32
30
votes
5 answers

Xcode 7 add trailing/leading/top/bottom constraints

In Xcode 6, I could use the Editor menu to Pin: Leading Space to Superview Trailing Space to Superview Top Space to Superview Bottom Space to Superview I can't find a way to do this in Xcode 7 beta. If I press the Align button in the Storyboard…
Casey Perkins
  • 1,853
  • 2
  • 23
  • 41
19
votes
5 answers

How do I set collection view's cell size via the auto layout

Hi I'm trying to resize the cell via the auto layout. I want display the cell by the 3 by 3. First Cell's margin left=0 Last Cell's margin right=0 And all of the cell's space has 1pt. Like an instagram. Should I set to Cell's Size? I want set…
Shawn Baek
  • 1,928
  • 3
  • 20
  • 34
17
votes
2 answers

In 7.3/9/2+ Swift how to disable rotation animation, when device rotates?

This question is strictly about iOS9+ Say you have an ordinary modern app (autolayout, storyboard, universal) which does allow all four rotation positions you want it to autorotate in the normal way, so it will change to your new constraint-based…
Fattie
  • 27,874
  • 70
  • 431
  • 719
16
votes
6 answers

iOS: How to Align The Center of a View With The Bottom of Another View With AutoLayout

I want to make the center of the head imageView with the bottom of the blue title imageView's keep alignment. How can I do it by using Autolayout? screen 4.0inches screen 4.7inches
ACMango
  • 163
  • 1
  • 1
  • 8
15
votes
3 answers

When the autolayout constraints set frames during view controller life cycle?

I have used autolayout constraints from storyboard. However in some cases, I want to calculate dynamic height of subview. I code this in viewDidAppear(), it works fine because this method is called after all view frames are set by layout…
Hiren Prajapati
  • 717
  • 3
  • 10
  • 25
14
votes
2 answers

Dynamically size Table View Cells using Auto Layout constraints

Update I have revised the question completely after my latest findings. Goal My goal is to implement the following effect: There is a simple table view The user selects a row The selected row expands, revealing another label below the original…
József Vesza
  • 4,775
  • 3
  • 27
  • 42
13
votes
4 answers

iOS constraints doesn't allow to use multiplier

I am trying to layout some custom views and when I try to activate the constraints, Xcode says that I can't use multiplier. Here is an example of the code: class MenuView: UIView { var addButton: AddButton! var settingsButton:…
Jaime_mc2
  • 673
  • 5
  • 18
13
votes
4 answers

Mimic UIStackView `fill proportionally` layout approach on iOS version prior to 9.0

The iOS 9.0 comes with UIStackView which makes it easier to layout views according to their content size. For example, to place 3 buttons in a row in accordance with their content width you can simply embed them in stack view, set axis horizontal…
Yakiv Kovalskyi
  • 1,737
  • 1
  • 15
  • 29
13
votes
4 answers

What is the basic difference between Auto Layout and Auto Resizing in iOS

I have been searching the proper difference between Auto Layout and Auto Resizing, but didn't able to find the exact answer. Where I can use "Auto Layout" and where "Auto Resizing" in app? Any help would be a part of thanks.
Arvind
  • 450
  • 1
  • 4
  • 11
12
votes
2 answers

Modifications to the layout engine must not be performed from a background thread after it has been accessed from the main thread

I am getting this crash after converting an existing UIViewController to Auto Layout and I can't figure out what is causing it. I did search for dispatch_async(dispatch_get_global_queue(...)) calls but none changes layout. The stack trace is also…
Iulian Onofrei
  • 9,188
  • 10
  • 67
  • 113
11
votes
2 answers

Changing Base value layout for iphone, affects ipad layout

I have a layout with size class width any, height any which is currently working for iPad landscape. I have a task to design same layout for iPhone portrait. When I started designing with size class of compact width ,regular height my base layout…
sujay
  • 1,845
  • 9
  • 34
  • 55
10
votes
3 answers

Undeleteable constraints added by InterfaceBuilder

I'm using Xcode 8 building for iOS 9 and using auto layout. Occasionally when I install a constraint in Interface Builder there's an immediate conflict. When I click the red disclosure and look at the conflicting constraints I'll see the one I just…
David U
  • 943
  • 1
  • 8
  • 22
10
votes
3 answers

changing the font size according to each iPhone size

is there any way to changing/auto resizing the font size according to the different iPhone screen as when i change the font size, the font size applied to other phone size as well which is too big. My Current Phone size is iPhone 6s plus (5.5…
aznelite89
  • 2,025
  • 4
  • 21
  • 32
1
2
3
69 70