Troubles with changing the font size in UITableViewHeaderFooterView

前端 未结 4 633
萌比男神i
萌比男神i 2020-12-16 12:16

Here is the problem,

I subclass a UITableViewHeaderFooterView and want to change the font size:

- (id)initWithFrame:(CGRect)frame
{
    self = [super         


        
4条回答
  •  一整个雨季
    2020-12-16 12:24

    It doesn't seem like the right place to put it, but you can change the font in the layoutSubviews method of your UITableViewHeaderFooterView subclass and it will apply properly.

    - (void)layoutSubviews {
        [super layoutSubviews];
    
        // Font
        self.textLabel.font = [UIFont systemFontOfSize:20];
    }
    

提交回复
热议问题