How to fix “Scrollable Content Size Ambiguity” in Xcode 11 (iOS 12, iOS 13) using Auto Layout
Disabling the content layout guides in the size inspector (ruler icon) in properties I was having the same issue, and by disabling the option it was gone.
Disabling the content layout guides in the size inspector (ruler icon) in properties I was having the same issue, and by disabling the option it was gone.
Update For iOS 11, StackViews with Custom Spacing Apple has added the ability to set custom spacing in iOS 11. You simply have to specify the spacing after each arranged subview. Unfortunately you can’t specify spacing before. stackView.setCustomSpacing(10.0, after: firstLabel) stackView.setCustomSpacing(10.0, after: secondLabel) Still way better than using your own views. For iOS 10 and … Read more
The following removes the warning without needing to disable animation. And assuming Apple eventually fixes the root cause of the warning, it shouldn’t break anything else. extension UIAlertController { func pruneNegativeWidthConstraints() { for subView in self.view.subviews { for constraint in subView.constraints where constraint.debugDescription.contains(“width == – 16”) { subView.removeConstraint(constraint) } } } } This can then … Read more
This is just an extension as to how to use “Vary Traits” quickly in your project for adding different layouts for iPad and iPhones. Please read this for understanding more on the Size classes. https://developer.apple.com/reference/uikit/uitraitcollection If you are skipping the example which follows below, do read the Summary in the end. OBJECTIVE : You need … Read more
I would suggest the following: Add a height constraint to your collection view. Set its priority to 999. Set its constant to any value that makes it reasonably visible on the storyboard. Change the bottom equal constraint of the collection view to greater or equal. Connect the height constraint to an outlet. Every time you … Read more
I don’t know this is clearly documented or not, but adding [cell layoutIfNeeded] before returning cell solves your problem. – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { TableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:@”TestCell”]; NSUInteger n1 = firstLabelWordCount[indexPath.row]; NSUInteger n2 = secondLabelWordCount[indexPath.row]; [cell setNumberOfWordsForFirstLabel:n1 secondLabel:n2]; [cell layoutIfNeeded]; // <- added return cell; }
Try to lower the priority of your _collapsedtextHeightConstraint to 999. That way the system supplied UIView-Encapsulated-Layout-Height constraint always takes precedence. It is based on what you return in -tableView:heightForRowAtIndexPath:. Make sure to return the right value and your own constraint and the generated one should be the same. The lower priority for your own constraint … Read more