我正在将现有应用转换为 AsyncDisplayKit/Texture
。我刚刚将 UITableView
转换为 ASTableNode
,但是,UITableView
依赖于 viewForHeaderInSection
。但是,我无法在 AsyncDisplayKit
的 ASTableDelegate
中找到委托(delegate)方法。
这个方法有替代方法吗?或者我应该开始寻找解决方法?
最佳答案
是的,我们没有。 我使用默认的 UIView 类:
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
static NSString *header = @"";
UITableViewHeaderFooterView *vHeader;
vHeader = [tableView dequeueReusableHeaderFooterViewWithIdentifier:header];
if (!vHeader) {
vHeader = [[UITableViewHeaderFooterView alloc] initWithReuseIdentifier:header];
vHeader.textLabel.backgroundColor = [UIColor clearColor];
vHeader.textLabel.font = [UIFont fontWithName:@"HelveticaNeue" size:14];
vHeader.textLabel.textColor = [UIColor tc_blueyGreyColor];
vHeader.contentView.backgroundColor = [UIColor whiteColor];
}
vHeader.textLabel.text = [self.viewModel titleForHeaderInSection:section];
return vHeader;
}
但是你也可以尝试调用 ASDisplayNode 中的 view
属性。
关于ios - AsyncDisplayKit 有 viewForHeaderInSection 的替代方案吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49733110/