gpt4 book ai didi

ios - UITableViewHeaderFooterView 外观

转载 作者:行者123 更新时间:2023-11-29 03:37:39 33 4
gpt4 key购买 nike

我在 didFinishLaunchingWithOptions 末尾使用以下代码 [[UITableViewHeaderFooterView Appearance] setTintColor:[UIColor WhiteColor]]; 来设置自定义的色调颜色UITableViewHeaderFooterView 我的主要问题是当我滚动表格 View 时,例如第 0 部分离开屏幕然后恢复为默认灰色任何想法如何解决这个问题我的可重用代码非常基本

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
ListSectionHeaderView *sectionHeaderView = [self.tableView dequeueReusableHeaderFooterViewWithIdentifier:@"ListSectionHeaderView"];
}

最佳答案

您必须先创建页眉页脚,然后重用它

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{

ListSectionHeaderView *sectionHeaderView = [self.tableView dequeueReusableHeaderFooterViewWithIdentifier:@"ListSectionHeaderView"];
if (!sectionHeaderView)
{
//// initialize the header here if the reuse return nil
sectionHeaderView = ....
}
///// also you have to return it
return sectionHeaderView;
}

关于ios - UITableViewHeaderFooterView 外观,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18930685/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com