Warm tip: This article is reproduced from stackoverflow.com, please click
button dropdown image swift

How to give text to left and image to right for a button(like dropdown) in swift?

发布于 2020-03-31 22:53:56

I am making a dropdown button using storyboard. for that, I need Select Operator text in the left and dropdown related image to right. I am using storyboard to make this design. here text and images both are moving like below.

enter image description here

but I want like below

enter image description here

for button I have given like below in storyboard

enter image description here

please suggest me how to achieve text one side and image another side for a button in swift.

Questioner
DevIos
Viewed
41
shraddha11 2020-01-31 19:18

You need to set Title Inset and Image inset for like this.

Image and Title Inset Here is the output