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

Autolayout - When using NSLayoutAttributeCenterX, what scale does the multiplier use?

When using the NSLayoutAttributeCenterX attribute, a multiplier of 1 results in a center that matches the referred view. Increasing the value moves it to the left and decreasing towards 0 moves it to the right. I have been able to achieve roughly…
Billy Lazzaro
  • 476
  • 2
  • 13
2
votes
1 answer

How to Add Bottom Safe Areal to Static UITableviewController ? Not in UITableview

I used Static UITableViewController For Registration Form but In iPhone X, XR, i want to ad Safe area but it's not affecting in Screen, Any Help would be appreciate. i added also footerView but below footer view space is remaining as it is as shown…
princ___y
  • 1,089
  • 1
  • 9
  • 27
2
votes
1 answer

imageview inside uitableviewcell collapses the cell

This is the tabel view cell with the image view class ChatTableViewCell: UITableViewCell { override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { super.init(style: style, reuseIdentifier: reuseIdentifier) …
j.doe
  • 305
  • 3
  • 16
2
votes
0 answers

How to track auto layout assertions from background thread

I am getting some auto layout assertions due to UI tasks getting called from background thread. To track this I added a symbolic breakpoint for -[NSISEngine _optimizeWithoutRebuilding] This breakpoint is getting called but I don't have the stack…
ArdenDev
  • 4,051
  • 5
  • 29
  • 50
2
votes
2 answers

UIStackView - Positioning Image up against edge of sibling

I am trying to create a custom UITableViewCell in iOS that contains a Label and a related image. The image needs to be as close the the trailing edge of the label as possible. Below is an image of the progress so far.The Red area is the Horizontal…
Pat Long - Munkii Yebee
  • 3,592
  • 2
  • 34
  • 68
2
votes
0 answers

How I can manage Adaptive layout via Autolayout

First of all apologize for the article if it is duplicate. After a lot of boxing with autolayout I don't get result. I am working on a application that manages on both phone and iPad. As I implemented design with autolayout in iPhone mode with all…
Gourav Joshi
  • 2,419
  • 2
  • 27
  • 45
2
votes
1 answer

How to resize ViewController root view automatically to fit its content?

When creating a new UIViewController the root view within the corresponding XIB file can be set to any fixed height. However, the root view should automatically fit its content. How can this be done? Create a new XIB file: Add a new subview to the…
Andrei Herford
  • 17,570
  • 19
  • 91
  • 225
2
votes
1 answer

UITableViewCell constraint updates only happening after scrolling

I've come across an annoying situation. I've found similar questions, but the answers didn't help me, so I was hoping I could get some advice. I have a custom UITableViewCell where I'm using a .xib file. I fetch some data when the app loads, and…
Pierce
  • 3,148
  • 16
  • 38
2
votes
3 answers

heightAnchor.constraint not change height of view

I use this code: func show(){ view.translatesAutoresizingMaskIntoConstraints = false view.leftAnchor.constraint(equalTo: view.leftAnchor, constant: 0).isActive = true view.topAnchor.constraint(equalTo: view.topAnchor, constant:…
2
votes
2 answers

Increase area of UIButton in UIStackView

I have couple of UIButtons embedded in UIStackView. I understand UIStackView takes only the intrinsic size of UIButton when laying it out. But I want to increase height/width of UIButton when inside UIStackView. Without UIStackView, I can easily…
Deepak Sharma
  • 5,577
  • 7
  • 55
  • 131
2
votes
1 answer

Animated transform only for superview

I'm trying to animate the scale of the parent outerView, but keep child innerView with it's size, so that parent view transform just clips it during animation. For some reason, an inverted transform is scaling child view to bigger size. Without…
Jurasic
  • 1,845
  • 1
  • 23
  • 29
2
votes
2 answers

Swift auto layouts change button position when some buttons are hidden

I have custom UICollectionViewCell as TaskCell in which I have added 4 buttons. All the Buttons are added programatically using auto layouts. Now when I hide some buttons then i want the other remaining buttons to take a place of hidden buttons.…
Deepak
  • 1,030
  • 2
  • 10
  • 21
2
votes
3 answers

How to insert a UITableViewCell at bottom with animation?

I have read https://stackoverflow.com/questions/ and tried as this: //UITableView self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; self.tableView.rowHeight = UITableViewAutomaticDimension; self.tableView.estimatedRowHeight =…
magic_9527
  • 243
  • 3
  • 18
2
votes
1 answer

How to add xib subviews with dynamic height to UIView

It should be easy to do and it's very easy in android(with LinearLayout) but I can't figure out how to do it in ios. I have UIView into which I want to add some dynamic height subviews. Subview is loaded from xib file and contains 2 UILabels with…
Martin Vandzura
  • 3,047
  • 1
  • 31
  • 63
2
votes
1 answer

Creating an Input Accessory View programmatically

I'm trying to create a keyboard accessory view programmatically. I've set up a container view and inside that I'm trying to set up a textfield, post button, and an emoji. Here's an example of what I'm trying to make. Click here to view the…
Dipali Bajaj
  • 57
  • 1
  • 7