Questions tagged [autolayout]

Auto Layout is a constraint-based, descriptive user interface layout system for OS X and iOS.

The Auto Layout system defines layout constraints for user interface elements. Constraints represent relationships between user interface elements such as “these views line up head to tail,” or “this button should move with this split view subview.” When laying out the user interface, a constraint satisfaction system arranges the elements in a way that most closely meets the constraints. Constraints are objects and can be established in storyboards and XIBs, exposed as outlets, and created or modified in code.

11052 questions
4
votes
0 answers

Cannot deactivate layout constraint

I have designed a part of my user interface in a XIB file using Interface Builder with Autolayout. I created an outlet for one of the layout constraints in the File's Owner class and called it theHatedConstraint (for no particular reason...). Now…
Mischa
  • 15,816
  • 8
  • 59
  • 117
4
votes
1 answer

Autolayout and Scrollview width fixed to screen (not content)

I have followed and number of exmaples (most of which are the same) such as https://www.youtube.com/watch?v=UnQsFlMGDsI I opena new project, drop a scrollview in and then a "content" view in that, constrain the scrollview to it's superview (top,…
Recycled Steel
  • 2,272
  • 3
  • 30
  • 35
4
votes
2 answers

Xcode; Set a autolayout constraint to a defined variable value

Is it possible to define a variable, and set a constraints constant value to that variable? Thereby making it possible to change many constraints by just changing the variable. I think I saw someone do this directly from interface builder ones?…
Wiingaard
  • 4,150
  • 4
  • 35
  • 67
4
votes
1 answer

UICollectionView crash in [_UIFlowLayoutSection updateEstimatedSizeForSection] in iOS9 - Xcode7

I try to using auto-layout with UICollectionViewCell. Demo project runs fine on iOS8 but crash on iOS9. I try debug deeper but cannot find any reason. Xcode stop at [_UIFlowLayoutSection updateEstimatedSizeForSection] Any idea?
zendobk
  • 548
  • 1
  • 5
  • 17
4
votes
1 answer

iOS 9 StackView inside ScrollView does not fill the width of the screen

I'm trying to make a UIScrollView containing a UIStackView with several layers of stack views nested inside. I would like to use AutoLayout, but there is something wrong with what I'm doing, and my brain is getting scrambled trying to figure it…
gred
  • 612
  • 1
  • 8
  • 15
4
votes
1 answer

Find which view is breaking constraints

I am having issues with Auto Layout, getting "Unable to simultaneously satisfy constraints." error. Now I have added identifiers to all my constraints, however, the conflicting constraints seem not to be created by me since I only see my identifiers…
Banana
  • 4,010
  • 9
  • 33
  • 49
4
votes
2 answers

How to change autolayout constraints when the device rotates?

I've set the constraints in IB as IBOutlet in the corresponding view controller. The values for such constraints that I set in IB and the storyboard are for portrait orientation. I need to change those constraints when the device changes to…
AppsDev
  • 12,319
  • 23
  • 93
  • 186
4
votes
1 answer

ImageView Scaling when scrolling down

How can I simply scaling imageView with autolayout when scrolling down ? Try to see parallax effect but not exactly what I wanted. I just want to use a scrollView and a header ImageView who can resize depends on scrollView position.
raphael
  • 777
  • 1
  • 9
  • 18
4
votes
0 answers

10.11 NSCollectionView - automatically resize so that no scrolling is required

I'm using a NSCollectionView with OS X 10.11's Flow layout to display a varying amount of content. If there are too many items displayed, the default is to show scroll bars according to the Scroll Direction property. In my case, I would like to…
Etan
  • 17,014
  • 17
  • 89
  • 148
4
votes
1 answer

How to hide inner view completely when superview height constant is set to zero

As you can see, I have a UIView(red color) that has constraints - leading, bottom, width and height. All set to default(1000) priorities except height(999). Inside this UIView are three UIButtons those have constraints - leading, top, width and…
user3693546
4
votes
1 answer

Assertion failure in -[NSLayoutConstraint constant]

I got the following error after running my app on my iPhone: Assertion failure in -[NSLayoutConstraint constant], /SourceCache/Foundation/Foundation /Layout.subproj/NSLayoutConstraint.m:6432015-10-26 08:43:06.080 AuberML[195:6172] *** Terminating…
Goutallier
  • 192
  • 1
  • 8
4
votes
3 answers

Why is a UIScrollView not scrolling vertically (using Auto Layout)?

My view hierarchy is UIView UIScrollView UIView1 -->UIView1.1 -->UILabel -->UILabel -->UILabel -->UILabel (bottom) I am using Autolayout. I have…
Nav
  • 435
  • 1
  • 4
  • 15
4
votes
4 answers

edgesForExtendedLayout ignored on iOS9 when using custom animation

iOS9 seems to ignore destination view controller's edgesForExtendedLayout when implementing custom animation using UIViewControllerAnimatedTransitioning, therefore the content ends up below the navigation bar. Any idea why this is happening? I've…
Mercurial
  • 2,095
  • 4
  • 19
  • 33
4
votes
0 answers

Why is the flow layout's section inset not respected when dynamic cell sizing is enabled in a UICollectionView?

According to many tutorials and posts like this one on Stackoverflow a UICollectionView's flow layout becomes dynamic once you set its estimatedItemSize property to a non-zero value. If this is the case the flow layout obtains each item size…
Mischa
  • 15,816
  • 8
  • 59
  • 117
4
votes
3 answers

Unable to make view equal width to cell in iOS?

I am making a custom cell in iOS.I have added prototype cell.I m trying to add a view inside a cell of equal width to parent cell.But the width of cell is not equal please tell me how should i do it? Constraints are: View structure: EDIT: In…
TechChain
  • 8,404
  • 29
  • 103
  • 228