Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
88 views

AutoLayout - equal heights based on taller view

This is conceptually similar to Autolayout height equal to MAX(multiple view heights) except that question is sizing a container view, but I am wanting both buttons to be sized to the height of the ...
ashipma's user avatar
  • 477
1 vote
0 answers
52 views

Determine value for default layoutMargins

The system changes the layoutMargins of the main view, according to size classes like for small iPhones it's left value is 16, for the X phones it's 20 Besides asking the view controllers for it's ...
Peter Lapisu's user avatar
  • 21.1k
3 votes
1 answer
1k views

UITableViewCell height not dynamic when constrained to UIStackview containing multi-line UILabels

I have a tableview cell that contains a UIStackView. The stack view contains two labels that could be multiple lines and another stackview at the bottom. This is how the cell should appear, but with ...
yamski's user avatar
  • 471
1 vote
2 answers
39 views

Constrain text to a location, then have it dynamically move if required

I am making a UITableView with two labels. I have constrained the secondLabel to be +12 from the firstLabel, meaning it will move along if the firstLabel contains a lot of text. However, that means if ...
Aaron's user avatar
  • 363
0 votes
1 answer
56 views

Why would an auto layout constraint be activated without setActive: being called?

I have a constraint in my app that I programmatically set to be inactive. However, when I pause the app shortly after setting it inactive, the debugger shows that it is active. If I set a breakpoint ...
tbodt's user avatar
  • 17.1k
0 votes
2 answers
21 views

How to keep fonts the same size across (where possible) different controls with autolayout?

I have several UILabels which span a different number of lines. I've set the font / size for each with different sizing classes. I've also set a minimum size. However I can't keep fonts the same size....
Jules's user avatar
  • 7,754
1 vote
2 answers
3k views

How to correctly determine keyboard and text field position on iOS?

I want to lift the view when the keyboard shows and the text field becomes invisible. Here is my code: @objc func keyboardWillShow(notification: NSNotification) { if let keyboardSize = (...
adsalpha's user avatar
  • 102
0 votes
1 answer
721 views

How can I space UITextField leading and training edges in a UIStackView?

I have two UITextFields in a vertical UIStackView. I want their leading and trailing edges to be 20 points away from the edge of the UIStackView. However I cannot figure how to do this without ...
Dan's user avatar
  • 5,363
8 votes
2 answers
3k views

UIStackView: push subviews to the edges ("Unlimited" spacing)

I am using UIStackView to define a list's layout. I am trying to achieve the effect similar to this: ||Item1---spacing---Item2|| So, the two items are being pushed to the sides of the UIStackView. ...
Richard Topchii's user avatar
1 vote
2 answers
174 views

Autolayout with UIScrollView

I am using autolayout in Xcode and am creating a fairly tall (1300px) ViewController with a uiscrollview to navigate up and down. I made the viewcontroller freeform so its dimensions are [375,1300]. I ...
Ryan Cocuzzo's user avatar
  • 3,229
0 votes
1 answer
72 views

Making UILabels in a stack view hug each other

I am making a promo page in my app to make the user want to buy the PRO version of the app. I am laying it out using a stack view, and I am trying to make the items spaced out well, which I have ...
D-A UK's user avatar
  • 1,194
2 votes
1 answer
1k views

Xcode Safe Area Glitch With iPhone SE & 4s

I was setting up constraints when I realize things don't look right on iPhone SE and 4s. As shown below, the safe area is out of bounds. Any way to get around it so I can get an accurate look at my ...
Dennis Lau's user avatar
0 votes
3 answers
72 views

Autolayout, several UILabels, lines in each, same font size?

I have a number of UILabels on a view and a varying amount of text in each. I need the font size to be the same in each. I’m using autolayout to position / size the labels. However some of the “g” ...
Jules's user avatar
  • 7,754
1 vote
1 answer
888 views

Enable safe areas programmatically

Is there a way to enable Safe Areas programmatically? Context: The app i'm working on is stuck to iOS 7 as target, and that probably won't change for a while. Xcode won't accept Safe Areas enabled ...
baguIO's user avatar
  • 439
1 vote
1 answer
50 views

How can I create a UITableViewCell with subview of set height using autolayout?

I have a table view cell (yellow) with one subview (red): The subview should have a fixed height of 100. And should have a border of 5 top, and 5 bottom to the cell. The table row needs to be dynamic:...
Just a coder's user avatar
  • 16.9k

15 30 50 per page
1
2 3 4 5
18