changing the color of titleFor Header in section

后端 未结 4 1485
别那么骄傲
别那么骄傲 2021-02-10 18:14
-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section 

{

}

Hi
I am very new in objective c..................

4条回答
  •  一个人的身影
    2021-02-10 18:42

    Please use following code & change the color of your UITableView header

    -(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
    {
        UIView *tempHeaderView=[[UIView alloc]initWithFrame:CGRectMake(0,0,320,44)];
        tempHeaderView.backgroundColor=[UIColor clearColor];
        UILabel *tempHeaderLabel=[[UILabel alloc]initWithFrame:CGRectMake(0,0,320,44)];
        tempHeaderLabel.backgroundColor=[UIColor clearColor];
        tempHeaderLabel.text=@"HEADER";
        [tempHeaderView addSubView: tempHeaderLabel];
        return tempHeaderView;
    }
    

提交回复
热议问题