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
2
votes
0 answers

UITableView dynamic footer height based on content size?

I need to display some footer text on an existing UITableView (ie. footer scrolls with table): the footer need to be at bottom of the screen if cells and footer can fit in one screen if remaining space on the screen can't fit the footer, footer…
Heuristic
  • 5,087
  • 9
  • 54
  • 94
2
votes
1 answer

Constraint's constant remains same but Label changes its position

I am designing a UITableViewCell which has 2 image and 1 label. I am using Xcode 9.2 and designed cell using Autolayout. The weird thing that I am facing is: when I try to test the UI design for different screen sizes by tapping on devices listed…
Sushil Sharma
  • 2,321
  • 3
  • 29
  • 49
2
votes
1 answer

UILabels vertical hugging priority

I have UICollectionViewCell with 2 UILabels that both can have 1 to N lines of text. I would like to use autolayout for calculation of cell height. I have set constraints for labels as follows: When I run my app, cells are not displayed properly.…
Skodik.o
  • 506
  • 4
  • 21
2
votes
1 answer

Landscape view issue with navigation bar

Default Navigation bar height is 64.But after change it's orientation to landscape navigation bar height changed to 28.I want to set Fix navigation bar size in all orientation.
Vinayak Bhor
  • 691
  • 1
  • 8
  • 20
2
votes
3 answers

how to make the label proportional to the screen size?

I am a beginner, I am trying to do an autolayout. I am trying to make the label 'HRIS' and 'Please login to continue' to be proportional to the screensize (its superview), I can do it for the login button and the image leaf as the picture above, we…
Alexa289
  • 8,089
  • 10
  • 74
  • 178
2
votes
2 answers

Storyboard shared constants for constraints

Is there any way to share constants between constraints in a storyboard (or better yet define them globally and use when needed)? Say, I want a distance from top to be equal to the distance from the left - those are not achievable by setting any…
Antek
  • 721
  • 1
  • 4
  • 27
2
votes
1 answer

Autolayout for UIButton in table view cell not working

I have added UIButton to my table view cell with autolayout but UIButton height constraint not working (Already set >=) Below is my autolayout constraint settings, Below is the xib design of cell,
Vandit Mehta
  • 2,572
  • 26
  • 41
2
votes
1 answer

CGAffineTransform scale moves center of view on iOS10 (and doesn't on iOS11)

I have an app which supports both iOS10 and iOS11. In the app I have a uiview pinned to a finger via pan gesture. Pan gesture moves view center only along y axis (x stays the same always). I also have CGAffineTransform tied to the gesture, the more…
iur
  • 2,056
  • 2
  • 13
  • 30
2
votes
2 answers

Autolayout : Need constraints for y position or height

I am trying to satisfying the constraint form a long time but getting above error i.e. is "Need constraints for y position or height" for Yellow View and Green View. Basically I have 2 UILabel (dynamic height) within UIView and UIImageView of 4:3…
Gaurav Pandey
  • 1,953
  • 3
  • 23
  • 37
2
votes
2 answers

Center a UIView inside a TableViewCell

I've been facing an weird issue which I have never experienced before (pretty new to iOS). I am trying to develop a blog reader app and I am using a UITableView inside my main View. Within the TableView I have added 1 prototype cell and modified…
Sebastian Nitu
  • 117
  • 1
  • 7
2
votes
0 answers

Xcode Storyboard Reset to Suggested Constraints Error

Started getting this today after upgrading to iOS 11: Any body have an ideas? I get this when I do Reset To Suggested Constraints: Was working for months until today. Here's the log: ================================= XCODE VERSION…
user439441
2
votes
1 answer

viewForFooterInSection not called for last section with reloadData

I want to refresh the section footer(s) using reloadData, but right now all sections are updated except for the last one - viewForFooterInSection is not called, even if the footer is visible. Scrolling the view is the only way to call…
Dan
  • 173
  • 2
  • 18
2
votes
2 answers

Objective C equivalent of Swift addConstraints?

i am a newbie in autolayout using code. addConstaints(NSLayoutConstraint.constraintsWithVisualFormat("H:|-16-[v0]-16-|",options:NSLayoutFormatOptions(), metrics:nil…
ios
  • 165
  • 1
  • 11
2
votes
1 answer

Fill super view using layoutAnchor

I have weird problem, because I can't fill whole area of super view using layout anchor this is my code from custom UIView class: private func setupTableView() { addSubview(tableView) …
Robert
  • 3,790
  • 1
  • 27
  • 46
2
votes
4 answers

How to build a layout of single line and multi line labels in iOS autolayout?

I have an application in swift,and have encountered an autolayout issue. I've come up with the solution to it, but it doesn't seem to work as expected. So, here's the issue: I have two labels in a table view cell. The first one should only have one…
annaoomph
  • 552
  • 1
  • 4
  • 22