4
3

More than 5 years have passed since last update.

swift ボタンの角を丸くする

Posted at

ボタンを角を丸くするコード

スクリーンショット 2019-05-05 23.43.44.png

形式

UIButtonの変数名.layer.cornerRadius = 角丸の大きさ

   @IBOutlet weak var startButton: UIButton!

    override func viewDidLoad() {
        super.viewDidLoad()

        startButton.layer.cornerRadius = 10.0

    }

上のコードではstartButtonというUIButtonの角を大きさ10にして丸くしてます。

4
3
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
4
3