UILabel
Subclass it and override
- (void)drawTextInRect:(CGRect)rect {
UIEdgeInsets insets = {5, 5, 5, 5};
[super drawTextInRect:UIEdgeInsetsInsetRect(rect, insets)];
}
UITextField
Subclass it and override
- (CGRect)textRectForBounds:(CGRect)bounds
{
return CGRectInset(bounds, 5.0f, 0);
}
- (CGRect)editingRectForBounds:(CGRect)bounds
{
return [self textRectForBounds:bounds];
}
No hay comentarios:
Publicar un comentario