Swift Tutorials: Aligning text and image on UIButton with help of UIEdgeInsets

Опубликовано: 06 Февраль 2020
на канале: Swift Tutorials
5,884
28

In this video, we will learn about UIEdgeInsets, and how to align text and image, or give padding to image and title for UIButton in swift. There are 3 types of edge insets

1) titleEdgeInsets: adding padding to title label rectangle
2) imageEdgeInsets: adding padding to uiimageview
3) contentEdgeInsets: adding padding to rectangle containing title and image

We will learn, how to align text and image on UIButton using imageEdgeInsets, titleEdgeInsets and finally with contentEdgeInsets.