I am trying to make an UIButton
programmatically with an icon and a title (as default, icon should be on the left next to the title). However, the icon is quite big in size so when I use myButton.setImage()
the icon stretches and takes up the entire button, the title also disappears.
imageEdgeInsets
but it does not make the title appear.
So is there any way to make the icon smaller (maybe .scaleToFit
) and the title appear again?
If not, how small the icon (relatively to the button) should I export?
See Question&Answers more detail:os