0xnshuman / timelinecards Goto Github PK
View Code? Open in Web Editor NEWPresenting timelines as cards, single or bundled in scrollable feed!
License: MIT License
Presenting timelines as cards, single or bundled in scrollable feed!
License: MIT License
Hi,
i have an issue with the following code in TimelineFeed:
private func addCard(_ card: TimelineCard) {
self.card = card
card.reload()
card.frame = CGRect(origin: CGPoint(x: 0.0, y: (headerView?.frame.origin.y ?? 0.0) + (headerView?.frame.height ?? 0.0)), size: card.bounds.size)
self.insertSubview(card, at: subviews.count)
let constraints: [NSLayoutConstraint] = [
NSLayoutConstraint(item: headerView ?? self, attribute: headerView != nil ? .bottom : .top, relatedBy: .equal, toItem: card, attribute: .top, multiplier: 1, constant: 1),
NSLayoutConstraint(item: self, attribute: .leading, relatedBy: .equal, toItem: card, attribute: .leading, multiplier: 1, constant: 1),
NSLayoutConstraint(item: self, attribute: .trailing, relatedBy: .equal, toItem: card, attribute: .trailing, multiplier: 1, constant: 1),
NSLayoutConstraint(item: self, attribute: .bottom, relatedBy: .equal, toItem: card, attribute: .bottom, multiplier: 1, constant: bottomPadding),
NSLayoutConstraint(item: card, attribute: .height, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1, constant: card.bounds.size.height)
]
constraints.forEach { $0.isActive = true }
}
It generates the following error messages:
2021-01-06 18:07:02.636373+0100 EinfachLeichterLeben[20536:946407] [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:0x60000250d630 _TtC20EinfachLeichterLebenP33_CD7A8457D9CF40B1C3DACE082F374E5216TimelineFeedCell:0x7fa758d40cc0'TimelineFeedCell'.top == EinfachLeichterLeben.TimelineCard:0x7fa758d414a0.top + 1 (active)>",
"<NSLayoutConstraint:0x60000250d270 V:[EinfachLeichterLeben.TimelineCard:0x7fa758d414a0]-(20)-| (active, names: '|':_TtC20EinfachLeichterLebenP33_CD7A8457D9CF40B1C3DACE082F374E5216TimelineFeedCell:0x7fa758d40cc0'TimelineFeedCell' )>",
"<NSLayoutConstraint:0x60000250f160 EinfachLeichterLeben.TimelineCard:0x7fa758d414a0.height == 192 (active)>",
"<NSLayoutConstraint:0x600002574870 'UIView-Encapsulated-Layout-Height' _TtC20EinfachLeichterLebenP33_CD7A8457D9CF40B1C3DACE082F374E5216TimelineFeedCell:0x7fa758d40cc0'TimelineFeedCell'.height == 211.333 (active)>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x60000250f160 EinfachLeichterLeben.TimelineCard:0x7fa758d414a0.height == 192 (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.
Latest Xcode, iOS 13 Target
Do you have any ideas, what i could do? It think it also breaks the delegate methods for the header and the card elements.
Thanks! Kay.
Hi,
Everything works until I add sub-items to a group, at which point the above error occurs. If I add a Group item without any items, the Group heading displays.
It's all good, except for the oddity with Group Items.
Any ideas?
TIA.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.