Eureka
Eureka copied to clipboard
Custom Header disappearing / not reloading after navigating back from PushRow
XCode 9.2 iOS 11 Eureka 4.01
I have a Custom Header from xib file that is displaying fine. But when I load a PushRow, make a selection, and the form comes back into view, the header is blank - no longer displaying the custom header view. If I scroll the form to where the header is off the screen, then scroll back to where header is visible - the custom header shows up again.
Followed the doc:
+++ Section("Unit Data"){ section in var header = HeaderFooterView<TableSectionHeader>(.nibFile(name: "TableSectionHeader", bundle: nil))
// Will be called every time the header appears on screen
header.onSetupView = { view, _ in
// Commonly used to setup texts inside the view
// Don't change the view hierarchy or size here!
view.lblTitle.text = "test"
}
section.header = header
}
EDIT: It appears that the .onSetupView() is NOT being called when the form re-appears after selecting an item from a PushRow. It is being called when I scroll the header off the screen and back into view.
Thank you.
@hou1nxb reload tableview on onCellSelection() event of your PushRow
Thanks for the response. This does in fact fix the header view issue. However, it causes incorrect and unpredictable behavior of the PushRow in question. The item selected may or may not appear on the form after selection.
Hello guys,
I have behaviour too, I tried the reloadData() in the onCellSelection, but it doesn't refresh the value of the row. If I remove it, the value of the row is back, but the custom header disappear :(
Is there any fix ? Thank you :)
Edit: I found a workaround to still update it
.onCellSelection { [weak self] _, _ in
self?.tableView?.reloadData()
}
.onChange { [weak self] _ in
self?.tableView?.reloadData()
}
Hi,
In the end, I still have this issue. :/
When I am scrolling down to hide the header view and release it, it is appearing
same issue here... no updates on this matter ?
Hey @adnacacio My workaround was to separate the tableview from my header and manage both separately :)
@adnacacio @gorbat-o Does this still happen? It does not happen when adding a header view in the Example project, so that either it has been fixed or it is related to something else in a FormViewController (not the PushRow itself).
Also, please make sure you always call super
when overriding methods
I'm having the same issue. Happened when I call reload()
in any row under the same form
. Also when I call removeAll()
under the Section
and add some new rows in, the custom section header also disappeared. It only reappear when showing it after hiding the section by scrolling down.
- I'm using Eureka 4.3.0
Similar situation also happened to me. I can't narrow down the cause (not sure if that happens due to tableview reloadData or set section hidden or shown again)?
But I am able to work around by set the section header again after "evaluateHidden" and before tableview reloadData.