UILabel のプロパティではいじれなく、カスタムビュークラスをつくる必要があるらしい。
(単純なframe サイズいじる実現も検索するとでてくるけど、背景色とかあると使えなさそう)
// MyLabel.h #import <Foundation/Foundation.h> @interface MyLabel : UILabel { } @end // MyLabel.m #import "MyLabel.h" @implementation MyLabel - (void)drawTextInRect:(CGRect)rect { UIEdgeInsets insets = {0, 10, 0, 10}; return [super drawTextInRect:UIEdgeInsetsInsetRect(rect, insets)]; } @end
"textRectForBounds:limitedToNumberOfLines:" はsizeToFit した時に呼ばれるらしい。
ので今回は使わなかった。
参考
iphone - UILabel text margin - Stack Overflow
http://stackoverflow.com/questions/3476646/uilabel-text-margin