LoginSignup
2
2

More than 5 years have passed since last update.

UILabelを角丸にする

Posted at

まずは、ヘッダーファイルに下記を追記し、QuartzCore.frameworkを読み込む。

#import <QuartzCore/QuartzCore.h>

そして、下記を追記。labelのところに使用するUILabel名を入れるとOK!

[[label layer] setCornerRadius:5.0];
[label setClipsToBounds:YES];

なお、5.0のところで丸みを調整する。値を小さくすれば丸みも小さくするという感じ。

参考URL:http://d.hatena.ne.jp/corrupt/20110413/1302686140

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2