Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/98.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/391.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios UITableViewHeaderFooterView外观_Ios_Objective C_Tableview - Fatal编程技术网

Ios UITableViewHeaderFooterView外观

Ios UITableViewHeaderFooterView外观,ios,objective-c,tableview,Ios,Objective C,Tableview,我正在使用以下代码[[UITableViewHeaderFooterView外观]setTintColor:[UIColor whiteColor]]在didFinishLaunchingWithOptions的末尾设置自定义UITableViewHeaderFooterView的色调我的主要问题是在滚动表格视图时,例如,第0节离开屏幕,然后恢复为默认灰色。如何解决此问题,我的可重用代码非常基本 - (UIView *)tableView:(UITableView *)tableView vie

我正在使用以下代码
[[UITableViewHeaderFooterView外观]setTintColor:[UIColor whiteColor]]
didFinishLaunchingWithOptions
的末尾设置自定义
UITableViewHeaderFooterView
的色调我的主要问题是在滚动表格视图时,例如,第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;
 }

我也在做同样的事情