をサブクラス化したUILabelので、これTitleLabelをいくつかの場所で使用できます。これTitleLabelにはカスタムフォントがあります。はlineheightで設定されますNSAttributedString。
これはdrawTextInRectオーバーライド メソッドです。
- (void)drawTextInRect:(CGRect)rect {
self.text = @"THIS IS A TEST";
NSMutableAttributedString *attStr = [[NSMutableAttributedString alloc] initWithString:self.text];
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
paragraphStyle.minimumLineHeight = 15.f;
paragraphStyle.maximumLineHeight = 15.f;
[attStr addAttribute:NSBackgroundColorAttributeName value:[UIColor yellowColor] range:NSMakeRange(0,7)];
[attStr addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, self.text.length)];
[attStr addAttribute:NSFontAttributeName value:[UIFont fontWithName:TITLE_FONT_NAME size:TITLE_FONT_SIZE] range:NSMakeRange(0, self.text.length)];
self.attributedText = attStr;
[super drawTextInRect:rect];
}
背景色はテスト用に追加されています。ご覧のとおり、黄色の背景色が適切な位置にあります。テキストTHIS ISは黄色の背景にあるはずですが、背景の上に配置されています。
TITLE_FONT_SIZEは15、別の場所で定義されています。

なぜこれが起こるのか誰にも分かりますか?