iPhone UILabel 高さをテキストの量で決める

http://www.hirano-dept.com/blog/2011/01/iphone-uilabel.html

NSString *str = @”sample string”;
CGSize size = [str
sizeWithFont:[UIFont boldSystemFontOfSize:13]
constrainedToSize:CGSizeMake(500, 2000)
lineBreakMode:UILineBreakModeWordWrap];
NSLog(@”String height: %d”, size.height);

http://blog.summerwind.jp/archives/1353/
投稿日:
カテゴリー: 過去Blog

コメントする

メールアドレスが公開されることはありません。

CAPTCHA