Overlap in UITableViewCell with UITableViewCellStyleSubtitle

I use a subtitle table cell and wanted my text to get a little bigger. Change of size

cell.textLabel.font = [UIFont boldSystemFontOfSize:30];

and cell height heightForRowAtIndexPathbefore 80I ran into a problem that is textLabelhalf hidden detailTextLabel. I am surprised that this is wrong. I tried to change the borders of the labels, but this did not affect. How to set "position", "content rect" or something else to have big textLabeland small detailTextLabel?

+3
source share
1 answer

, iOS. , "" ( , / ..), , . init layoutSubviews :

- (void)layoutSubviews
{
    [super layoutSubviews];
    // Set the content view frame
    CGRect cvFrame = self.contentView.frame;
    cvFrame.origin.y = 0;
    cvFrame.size.height = 80;
    self.contentView.frame = cvFrame;
    // Set the text label position
    CGRect tlFrame = self.textLabel.frame;
    tlFrame.origin.y = 2;
    self.textLabel.frame = tlFrame;
    // Set the detail label position
    CGRect dtlFrame = self.detailTextLabel.frame;
    dtlFrame.origin.y = 2 + tlFrame.size.height + 2;
    self.detailTextLabel.frame = dtlFrame;
}

, [super layoutSubviews], . , .

+1

Source: https://habr.com/ru/post/1717190/


All Articles