Closed seongki1 closed 6 years ago
I have the same issue when it comes to tableViews as well :(
The problem was that the card did not layout when the title label text is set. I'll fix that in the next update.
To solve this just call "layout()" after title is set:
/**
Text of the title label.
*/
@IBInspectable public var title: String = "The Art of the Impossible" {
didSet{
titleLbl.text = title
*** layout() ***
}
}
Thank you so much for the reply. But sadly, I think the problem does not seem to be solved yet. The cards are okay, but the detailview does not show up correctly - not showing the label and the x button either.
The former is normal, and the latter has the issue. Thanks a lot.
The x button should be hidden when the scroll view is at the top, fixed that. It took me a bit to find out, but the problem of the label was that the card in the cell was being reused and the DetailViewController(of the card's repo) was messing everything up.
Now a new detailVC is instantiated every time shouldPresent() is called
fileprivate var detailVC: DetailViewController!
public func shouldPresent( _ contentViewController: UIViewController?, from superVC: UIViewController?, fullscreen: Bool = false) {
if let content = contentViewController {
detailVC = DetailViewController()
detailVC.transitioningDelegate = self
self.superVC = superVC
detailVC.addChildViewController(content)
detailVC.detailView = content.view
detailVC.card = self
detailVC.delegate = self.delegate
detailVC.isFullscreen = fullscreen
}
}
For the button just do:
xButton.alpha = 0
in DetailViewController's viewDidLoad()
Thank you so much for the quickest fix. It works now, like a charm! You are So Genius😉 Have a nice weekend!
Card Detail View Controller not working while using FSPagerView (https://github.com/WenchaoD/FSPagerView)
Hello, I am making UI just like iOS11 app store, using Cards and Detailview with UICollectionView. I 've tried like the attached file, But..
It shows the DetailView well first a few tapping, but after loading and dismissing a few times the detailviews with swiping the collectionviewcells, the detailview does not show up correctly. I guess indexPaths are being messed up after that. And maybe it's concerned with the dequeueReusableCell..
Please check my code. Thanks a lot. CardDemo.zip