Skip to content

Instantly share code, notes, and snippets.

@myaaaaa-chan
Created May 10, 2013 02:02
Show Gist options
  • Save myaaaaa-chan/5551936 to your computer and use it in GitHub Desktop.
Save myaaaaa-chan/5551936 to your computer and use it in GitHub Desktop.
UILabelを角丸にする&パディングを設定する方法 ref: http://qiita.com/items/cb168bd041c77ec54b0a
#import <QuartzCore/QuartzCore.h>
- (void) hoge
{
[[label layer] setCornerRadius:5.0];
[label setClipsToBounds:YES];
}
- (void)drawTextInRect:(CGRect)rect
{
// top, left, bottom, right
UIEdgeInsets insets = {0, 20, 0, 20};
return [super drawTextInRect:UIEdgeInsetsInsetRect(rect, insets)];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment