Questions tagged [imageedgeinsets]

9 questions
124
votes
16 answers

iPhone UIButton - image position

I have a UIButton with text "Explore the app" and UIImage (>) In Interface Builder it looks like: [ (>) Explore the app ] But I need to place this UIImage AFTER the text: [ Explore the app (>) ] How can I move the UIImage to the right?
Pavel Yakimenko
  • 3,234
  • 4
  • 28
  • 33
73
votes
7 answers

How to add padding-left on a UIButton created programmatically?

I am having a trouble adding left padding on a UIButton. I have a UIButton with UIControlContentHorizontalAlignmentLeft. I want the text to be displayed on the left side but it is too left. when I give the border, it doesn't look good. I would like…
MissStack
  • 833
  • 1
  • 6
  • 6
6
votes
2 answers

How to remove left padding from UIButton?

How to remove left padding from UIButton? I have been created button with this code: let button = UIButton(...) button.setImage(UIImage(named: "plus")?.withRenderingMode(.alwaysTemplate), for: .normal) button.setTitle("Text", for:…
1
vote
1 answer

UIButton image on right title in center

I was searching through the post and trying to figure it out by myself but it is hardly working. I want to use an UIButton with image and title. UIButton spans across (almost) whole screen. The image should be positioned on the right edge of the…
Dzior
  • 1,485
  • 1
  • 14
  • 30
1
vote
2 answers

How do I put the image on the right side of the button and the text align left

I have a UIButton with image and text. How do I align the image to the right, and align the text to the left?
0
votes
1 answer

how to set the values for UIEdgeinset for button

I wanted to increase the button touch area without without actually increasing its original size. When it comes to insets there are so many in Button and there is no clear documentation I could find on the differences Content Insets Title…
Shiva
  • 545
  • 1
  • 10
  • 41
0
votes
1 answer

Swift 3 | Button Label under Image AND resize Image

I'm displaying an image on top of a button, everything is OK on iPhone 7 e.g. : I set button background color to blue to see the button frame. Since I set an aspect ratio on my button's parent view, the button size change on small device, and on…
Aximem
  • 714
  • 8
  • 27
0
votes
1 answer

ImageEdgeInsets Square Aspect Ratio

Is it possible to use ImageEdgeInsets to constrain an image to a square size? I have a UI Image inside of a button and I would like to make it a square size inside the button. Does ImageEdgeInsets offer the ability to maintain an aspect ratio?…
Josh D.
  • 151
  • 1
  • 11
0
votes
1 answer

UIButton imageEdgeInsets not updating at run time

So here is my code, it's fairly strait forward. CGFloat spaceing = 5; self.premiumButton.imageEdgeInsets = UIEdgeInsetsMake(spaceing,spaceing,spaceing,spaceing) NSLog(@"immage - %@", …
Bill
  • 105
  • 9