有谁知道如何在重新加载部分时通过闪烁来获取自定义部分的页眉/页脚视图?
Section(header:"",footer:"") {section in
section.tag = "main"
var header = HeaderFooterView<GenericSection>(HeaderFooterProvider.Class)
header.onSetupView = { v,s in
v.label.frame = CGRect(x: 0, y: 0, width: UIScreen.mainScreen().bounds.width - 30, height: 20 )
v.label.text = self.row.title
v.label.numberOfLines = 0
v.label.textAlignment = .Justified
v.label.font = UIFont.preferredFontForTextStyle(UIFontTextStyleHeadline)
v.label.textColor = UIColor(red:0.47, green:0.47, blue:0.49, alpha:1.0)
v.label.frame = v.label.bounds
v.label.sizeToFit()
v.bounds = CGRect(x: -8, y: -8, width: v.label.bounds.width - 15, height: v.label.bounds.height + 25)
}
section.header = header
section.footer = nil
}
如果我使用Section(header:"test",footer:"test2")
标题视图,那么我想要的任何表单修改都不会闪烁。但是,我使用自定义边距并向页眉添加图标,这就是为什么我需要自定义视图作为页眉/页脚。有没有我没有在 .onSetupView 上设置的属性来解决这个问题?