LoginSignup
33
24

More than 5 years have passed since last update.

【Xcode】StoryboardでViewを角丸にする

Posted at

やり方

Viewならなんでも大丈夫ですが、今回はButtonでやってみます。

まず、Storyboardでボタンを選択した状態で
右側のバーのUser Defined Runtime Attributesを表示させてください。

そして、Key Pathにlayer.cornerRadius と入力し、TypeはNumberを選択してください。
Valueの値で丸みを調整します。
 
こんな感じです。
image

Storyboardでは角は丸くなっていませんが、実際にアプリを動かすと反映されています。

参考

Giving UIView rounded corners

33
24
2

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
33
24