角丸にする
LibraryにQuatzCore.frameworkを足す
# import <QuartzCore/QuartzCore.h>
- (void) hoge
{
[[label layer] setCornerRadius:5.0];
[label setClipsToBounds:YES];
}
パディングを設定する
サブクラスを作った方が良いそうです。
MyUILabel.m
- (void)drawTextInRect:(CGRect)rect
{
// top, left, bottom, right
UIEdgeInsets insets = {0, 20, 0, 20};
return [super drawTextInRect:UIEdgeInsetsInsetRect(rect, insets)];
}