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
-1
votes
1 answer

Constraints in iOS development

Is it a right choice to start developing with Xcode without add any constraints and just developing with a unique device (for example iPhone 7) running its own simulator; and when the application is finished adding all the constraints for the other…
Matteo
  • 59
  • 1
  • 6
-1
votes
2 answers

Add padding to UILabel in Auto Layout

How do I add padding to a UILabel while positioning and sizing it with Auto Layout? I tried subclassing it and overriding the drawTextInRect: method like this: - (void)drawTextInRect:(CGRect)rect { CGFloat borderWidth = 5; CGFloat…
Iulian Onofrei
  • 9,188
  • 10
  • 67
  • 113
-1
votes
1 answer

iOS Autolayout: constraints for three squares

I'm trying to achieve a very simple scenario using auto layout but without success. Please help me... I need 3 squares with a dynamic size(ex: on iPad, all of them should be scaled) on a table cell. I have spend already some hours finding a…
hackmajoris
  • 216
  • 2
  • 9
-1
votes
1 answer

Constraints not working in UITableviewCells through storyboard, the content is always left aligned with respect to the main view

I have a label in my table cell which has some static content and it needs to be center aligned with respect to its main view. The constraints are horizontally and vertically in container. But when i run the app then the label is always left aligned…
cherry_4
  • 158
  • 2
  • 17
-1
votes
2 answers

how to put constraints on views in interface builder to satisfy all iphone Screen in Xcode 8

I have been trying the following such as pinning, aspect ratio, vertical spacing ,horizontal/vertical spacing,leading/trailing space; but it is not working uniformly for all iPhone screen from iPhone se and above.
-1
votes
2 answers

Find out who adds a specific auto layout constraint

How do I find out who adds a specific auto layout constraint? Because I'm seeing some constraints which I'm certain I did not add.
Iulian Onofrei
  • 9,188
  • 10
  • 67
  • 113
-1
votes
1 answer

set subViews with different width horizontal in a superview

I wanted to create 6 subviews in a view, which have different width & same height. It should fit horizontal, all screen resolutions for iPad and iPhone.Can anyone please help me on this.
RashmiG
  • 318
  • 1
  • 4
  • 11
-1
votes
1 answer

how can i add height constraint

I have this layout for my iphone app (image 1). Now what I want to do is add a constraint to second stack view such that my stack view tree would look like image 2. Now the problem is that whenever i try to add the constraint by clicking on the…
Em Ae
  • 8,167
  • 27
  • 95
  • 162
-1
votes
1 answer

Xcode 8 Storyboard changes views frames automatically

In our project we are using xcode 8 combining autolayout and autoresizing. After having sometime, storyboard gets messed up. Subviews of Viewcontroller's view gets misplaced. How to get rid of this problem? Please help.
-1
votes
3 answers

Wrap a label with another view IOS

I want to create a label, over a black rectangle with rounded corners and some padding between the label's borders and the rectangle's borders. Its also necessary to wrap correctly the label if the text length gets changed in runtime. The appearance…
Addev
  • 31,819
  • 51
  • 183
  • 302
-1
votes
1 answer

Swift : Adding Constraints to UILabel Programmatically

So I had a break from iOS dev for 4 months and its seems I have forgotten everything. All I am trying to do is place a Label programmatically at 0,0, size 200,50. I hear there is a few changes in iOS8 which I don't remember let x : CGFloat =…
Burf2000
  • 5,001
  • 14
  • 58
  • 117
-1
votes
1 answer

Objective-c: How to add borders to a UIView with auto layout

How to add a border with specific color and thickness to a UIView when using auto layout in objective-c ?
Fadi Obaji
  • 1,454
  • 4
  • 27
  • 57
-1
votes
2 answers

What will be the constraint for equally spaced buttons in swift programming?

[When i run this in Xcode beta, only left most button is visible. Other buttons seems to be collapsed. Can somebody help me on this to fix the constrains for the 3 buttons, please?][1] https://i.stack.imgur.com/UOGLO.png
jakk
  • 1
  • 2
-1
votes
2 answers

Give 0 height to table view cell using autolayout

I have some dummy objects in my data source array. I don't want to show them on screen. I also cannot remove them from data source array. I am using proper constraints to get dynamic cell height. Is there a way I can show a cell of 0 height for…
-1
votes
1 answer

content hugging does not work

I have a UIView that has a subview I want the yellow view to grow only as the length of the label is unfortunately it grows to the maximum width of the screen minus the forced margins i gave it between the white view and the yellow view left and…
Lena Bru
  • 13,521
  • 11
  • 61
  • 126