Guest User

Untitled

a guest
Dec 14th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. internal lazy var layout: UICollectionViewFlowLayout = {
  2. let layout = UICollectionViewFlowLayout()
  3. layout.minimumLineSpacing = 16
  4. layout.sectionInset = UIEdgeInsets(top: layout.minimumLineSpacing, left: layout.minimumLineSpacing , bottom: layout.minimumLineSpacing , right: layout.minimumLineSpacing )
  5. layout.estimatedItemSize = CGSize(width: UIScreen.main.bounds.size.width - (layout.sectionInset.left + layout.sectionInset.right), height: 10)
  6. return layout
  7. }()
  8.  
  9. override open func preferredLayoutAttributesFitting(_ layoutAttributes: UICollectionViewLayoutAttributes) -> UICollectionViewLayoutAttributes {
  10. setNeedsLayout()
  11. layoutIfNeeded()
  12. let size = contentView.systemLayoutSizeFitting(layoutAttributes.size)
  13. var newFrame = layoutAttributes.frame
  14. newFrame.size.height = ceil(size.height)
  15. layoutAttributes.frame = newFrame
  16. return layoutAttributes
  17. }
  18.  
  19. [LayoutConstraints] Unable to simultaneously satisfy constraints.
  20. Probably at least one of the constraints in the following list is one you don't want.
  21. Try this:
  22. (1) look at each constraint and try to figure out which you don't expect;
  23. (2) find the code that added the unwanted constraint or constraints and fix it.
  24. (
  25. "<NSLayoutConstraint:0x600003c1e490 V:|-(0)-[UIView:0x7fdc8bead5d0] (active, names: '|':VLCContentCollectionViewCell:0x7fdc8becf8e0 )>",
  26. "<NSLayoutConstraint:0x600003c1ec60 V:[UIView:0x7fdc8bead5d0]-(0)-| (active, names: '|':VLCContentCollectionViewCell:0x7fdc8becf8e0 )>",
  27. "<NSLayoutConstraint:0x600003c4bb60 V:|-(0)-[VLAsyncImageView:0x7fdc8bea20a0] (active, names: '|':UIView:0x7fdc8bead5d0 )>",
  28. "<NSLayoutConstraint:0x600003c43070 V:[VLAsyncImageView:0x7fdc8bea20a0]-(0)-| (active, names: '|':UIView:0x7fdc8bead5d0 )>",
  29. "<NSLayoutConstraint:0x600003c5f340 VLAsyncImageView:0x7fdc8bea20a0.height == 100 (active)>",
  30. "<NSLayoutConstraint:0x600003f8cb90 'UIView-Encapsulated-Layout-Height' VLCContentCollectionViewCell:0x7fdc8becf8e0.height == 10 (active)>"
  31. )
  32.  
  33. Will attempt to recover by breaking constraint
  34. <NSLayoutConstraint:0x600003c5f340 VLAsyncImageView:0x7fdc8bea20a0.height == 100 (active)>
  35.  
  36. Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
  37. The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
Add Comment
Please, Sign In to add comment