All Questions
Tagged with ios autolayout
9,599
questions
0
votes
1
answer
36
views
How to force break lines of a UILabel cell in a UICollectionView (Compositional Layout)
I have a UICollectionView that acts as a list of tags.
It uses a horizontal compositional layout.
Here is a screenshot:
My problem is that if I have a tag longer than the collection's width, it ...
0
votes
2
answers
81
views
Why is KeyboardLayoutGuide not applied in viewIsAppearing() in iOS 15.0?
Since viewIsAppearing() appeared, I am using addSubview() in viewDidLoad() and applying Constraint in viewIsAppearing().
I placed the SearchBar at the bottom of the screen, and used ...
0
votes
0
answers
45
views
Crash: Thread 1: "Tried accessing the col index for a variable that is a row head:0x6000021a7b60.marker{id: 8773}.brokenNegError{id: 23368}" in swift
I am developing a chat application for iOS in swift. I am using different cells for text message, images, files etc having attributed labels in each cell to display formatted text, to sync with web ...
-2
votes
1
answer
58
views
Why does UIImage with SymbolConfiguration change UIImageView frame?
I am making UIImageView with UIImage.SymbolConfiguration.
let config = UIImage.SymbolConfiguration(font: .preferredFont(forTextStyle: .title1))
imageView.image = UIImage(systemName: "person",...
-1
votes
1
answer
26
views
When using autoresizing mask layout. How do I satisfy the warnings?
I get this warning.
Views without any layout constraints may clip their content or overlap other views.
However, I am using autoresizing mask, I shouldn't need to use constraints. Is there something ...
0
votes
0
answers
41
views
Align image inside DTImageTextAttachment
I am trying to add an image to DTAttributedTextContentView and align it using DTImageTextAttachment like so:
func addAndDisplayImage() {
guard let image = UIImage(named: "test") else {
...
1
vote
1
answer
100
views
How to right align a UIStackView inside a UIScrollView when the stack view's size is smaller than scroll view?
Please look at the below picture of my storyboard to understand the layout of my views.
On the left side is a horizontal UIStackView with 2 buttons. This is okay.
On the right side of the above stack ...
0
votes
0
answers
23
views
UIView animation layoutIfNeeded causes top Constraint to break at the start of animation if not called on superview
I am able to demonstrate the issue with the below simple example code.
I basically have a custom View (sort of like a nav bar) on which I animate the bar to hide/show the blue area (which will contain ...
0
votes
1
answer
58
views
Sizing DTAttributedTextContentView based on its attributedString
I am trying to self size DTAttributedTextContentView inside the collection cell based on its attributed text.
The problem I face is that when I set attributedTextContentView width constraints like so:
...
-1
votes
1
answer
40
views
layerClass breaks auto layout
I made a custom view which has CAGradientLayer as a layer, and I added this view on the other view with bottom anchor. It was just very simple auto layout constraint with bottom, leading, trailing and ...
0
votes
1
answer
69
views
UILabel not drawing text properly in UICollectionViewCell
I have a UILabel that sits inside a UICollectionViewCell. The UILabel is multiple lines and may be different sizes based off of the text supplied. The cell sits in a collectionview with a simple ...
0
votes
0
answers
39
views
iOS: When layoutIfNeeded() is called on a specific subview, it is not displayed on the screen
I am dynamically adding and displaying a custom view. At this time, the custom view has subviews.
When showing a custom view and additionally showing internal subviews, I am curious as to why the ...
4
votes
0
answers
389
views
Modifications to the layout engine must not be performed from a background thread on iOS 17 and above
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Modifications to the layout engine must not be performed from a background thread after it has been accessed from ...
0
votes
1
answer
219
views
Content hugging and content compression resistance with minimum margin between views
I was trying to create a UI with two labels placed horizontally in parallel to other edges on the screen so that they can grow according to the content they receive.
and
I tried setting up content ...
6
votes
1
answer
422
views
Auto Layout Constraint Conflict in SwiftUI When Tapping TextField
I am developing an iOS app using SwiftUI and have encountered an Auto Layout constraint conflict issue that appears when tapping on a TextField within a LoginView. I've tried several troubleshooting ...