Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- internal lazy var layout: UICollectionViewFlowLayout = {
- let layout = UICollectionViewFlowLayout()
- layout.minimumLineSpacing = 16
- layout.sectionInset = UIEdgeInsets(top: layout.minimumLineSpacing, left: layout.minimumLineSpacing , bottom: layout.minimumLineSpacing , right: layout.minimumLineSpacing )
- layout.estimatedItemSize = CGSize(width: UIScreen.main.bounds.size.width - (layout.sectionInset.left + layout.sectionInset.right), height: 10)
- return layout
- }()
- override open func preferredLayoutAttributesFitting(_ layoutAttributes: UICollectionViewLayoutAttributes) -> UICollectionViewLayoutAttributes {
- setNeedsLayout()
- layoutIfNeeded()
- let size = contentView.systemLayoutSizeFitting(layoutAttributes.size)
- var newFrame = layoutAttributes.frame
- newFrame.size.height = ceil(size.height)
- layoutAttributes.frame = newFrame
- return layoutAttributes
- }
- [LayoutConstraints] Unable to simultaneously satisfy constraints.
- Probably at least one of the constraints in the following list is one you don't want.
- Try this:
- (1) look at each constraint and try to figure out which you don't expect;
- (2) find the code that added the unwanted constraint or constraints and fix it.
- (
- "<NSLayoutConstraint:0x600003c1e490 V:|-(0)-[UIView:0x7fdc8bead5d0] (active, names: '|':VLCContentCollectionViewCell:0x7fdc8becf8e0 )>",
- "<NSLayoutConstraint:0x600003c1ec60 V:[UIView:0x7fdc8bead5d0]-(0)-| (active, names: '|':VLCContentCollectionViewCell:0x7fdc8becf8e0 )>",
- "<NSLayoutConstraint:0x600003c4bb60 V:|-(0)-[VLAsyncImageView:0x7fdc8bea20a0] (active, names: '|':UIView:0x7fdc8bead5d0 )>",
- "<NSLayoutConstraint:0x600003c43070 V:[VLAsyncImageView:0x7fdc8bea20a0]-(0)-| (active, names: '|':UIView:0x7fdc8bead5d0 )>",
- "<NSLayoutConstraint:0x600003c5f340 VLAsyncImageView:0x7fdc8bea20a0.height == 100 (active)>",
- "<NSLayoutConstraint:0x600003f8cb90 'UIView-Encapsulated-Layout-Height' VLCContentCollectionViewCell:0x7fdc8becf8e0.height == 10 (active)>"
- )
- Will attempt to recover by breaking constraint
- <NSLayoutConstraint:0x600003c5f340 VLAsyncImageView:0x7fdc8bea20a0.height == 100 (active)>
- Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
- 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