The default implementation vertically centers the text and does not preserve the contentMode property. Pull drawTextInRect: into a subclass.
@implementation TopLeftLabel -(void) drawTextInRect:(CGRect)inFrame { CGRect draw = [self textRectForBounds:inFrame limitedToNumberOfLines:[self numberOfLines]]; draw.origin = CGPointZero; [super drawTextInRect:draw]; } @end
The baselineAdjustment property is performed strictly for when the font size is adjusted according to the width.
source share