Swift 从PushRow返回后,Eureka表单自定义标题消失/未重新加载
我有一个来自xib文件的自定义头,显示得很好。但是当我加载一个PushRow,进行选择,表单返回到视图中时,标题是空白的——不再显示自定义标题视图。如果我将表单滚动到标题不在屏幕上的位置,然后滚动回标题可见的位置-自定义标题再次显示 以下是示例文档:Swift 从PushRow返回后,Eureka表单自定义标题消失/未重新加载,swift,eureka-forms,Swift,Eureka Forms,我有一个来自xib文件的自定义头,显示得很好。但是当我加载一个PushRow,进行选择,表单返回到视图中时,标题是空白的——不再显示自定义标题视图。如果我将表单滚动到标题不在屏幕上的位置,然后滚动回标题可见的位置-自定义标题再次显示 以下是示例文档: +++ Section("Unit Data"){ section in var header = HeaderFooterView(.nibFile(name: "TableSectionHeader", bundle: nil))
+++ Section("Unit Data"){ section in
var header = HeaderFooterView(.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
}
编辑:当表单在从推行中选择项目后重新显示时,似乎没有调用.onSetupView()。当我从屏幕上滚动标题并返回视图时,会调用它
代码9.2
运行iOS 11的iPad
尤里卡4.0.1
多谢各位
编辑日期:2018年12月9日
我无法弄清楚为什么会发生这个问题。我也在Eureka GitHub上发布了这个问题,没有解决方案。我使用的解决方法是以编程方式重新创建头视图,而不是xib文件。然后根据文档添加视图
Section(){ section in
section.header = {
var header = HeaderFooterView<UIView>(.callback({
let view = UIView(frame: CGRect(x: 0, y: 0, width: 100, height: 100))
view.backgroundColor = .red
return view
}))
header.height = { 100 }
return header
}()
}
Section(){Section in
节头={
var header=HeaderFooterView(.callback)({
let view=ui视图(帧:CGRect(x:0,y:0,宽度:100,高度:100))
view.backgroundColor=.red
返回视图
}))
header.height={100}
回流集管
}()
}
这当然很痛苦——但我在定制的Eureka行上投入了大量资金,需要使用此表单。您是否找到了解决方案,我也有同样的问题?