I create a UILabel with following code:
UILabel *textLabel = [[UILabel alloc] initWithFrame:CGRectZero];
textLabel.font = [UIFont systemFontOfSize:30];
textLabel.backgroundColor = [UIColor redColor];
textLabel.text = @"0";
[textLabel sizeToFit];
textLabel.center = CGPointMake(100, 100);
[self.view addSubview:textLabel];
and the textLabel.bounds.height seems higher than the text font actual height. like following:
but because the designer marks the space of two UILabel based on real text size, so I can't just assign a value for two UILabel use designer's mark space, I need to run app in simulator to check it's correct.
I wan to know how to make UILabel sizeTofit to get the real height of text, no padding between text.