Created
July 30, 2012 04:11
-
-
Save hisasann/3204449 to your computer and use it in GitHub Desktop.
UILabelにPadding入れる
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "PaddingLabel.h" | |
@implementation PaddingLabel | |
- (id)initWithFrame:(CGRect)frame { | |
self = [super initWithFrame:frame]; | |
if (self) { | |
// Initialization code | |
} | |
return self; | |
} | |
/* | |
// Only override drawRect: if you perform custom drawing. | |
// An empty implementation adversely affects performance during animation. | |
- (void)drawRect:(CGRect)rect | |
{ | |
// Drawing code | |
} | |
*/ | |
- (void)drawTextInRect:(CGRect)rect { | |
UIEdgeInsets insets = {5, 5, 5, 5}; | |
return [super drawTextInRect:UIEdgeInsetsInsetRect(rect, insets)]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment