

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to make the corners of a button round in iOS?
You might come across a scenarios where you received a UI where the buttons are rounded, and you might wonder how to do that? So here we will see how to make corners of a button round.
We will be seeing both the ways to make the button rounded, one using Storyboard and another programmatically.
Let’s get started! First we will make the corners of button rounded using Storyboard.
Step 1 − Open Xcode → New Projecr → Single View Application → Let’s name it “RoundedButton”
Step 2 − Open Main.storyboard and add a button as show below
Step 3 − Now select the button and tap on Utility area and update the User Defined Runtime Attributes to below value.
Now this value you can modify i.e increase or decrease based on requirement.
In the second method we are going to make the corner rounded Programmatically.
From the Main.storyboard get the @IBOutlet in ViewController.swift and name it “doButtonRounded” and update the same property layer.cornerRadius.
Use the below code for complete reference.
import UIKit class ViewController: UIViewController { @IBOutlet var doButtonRounded: UIButton! override func viewDidLoad() { super.viewDidLoad() doButtonRounded.layer.cornerRadius = 20 } }
- Related Questions & Answers
- How to make the corners of a button round in Android?
- How to make the controlling corners of a Circle transparent using FabricJS?
- How to add rounded corners to a button with CSS?
- How do I create a TableView with rounded corners in iOS?
- How to make the controlling corners of an Ellipse transparent using FabricJS?
- How to make a background 25% transparent on iOS
- How to make a Button using the Tkinter Canvas widget?
- How to make custom dialog with rounded corners in android?
- How to make dotted/dashed line in iOS?
- Change Color of Button in iOS when Clicked
- How to make iOS UIWebView display a mobile website correctly?
- Make image round with Bootstrap
- How to make the phone call in iOS 10 using Swift?
- How to make a Button Hover to change the Background Color in Tkinter?
- How to customise iOS button to set text and color?