MarksCode
MarksCode

Reputation: 8574

Widen border of UIButton?

I have a button inside a horizontal stack view and am trying to give it a border using the Runtime Attributes in Xcode. Here is what my storyboard looks like:

storyboard

When I run my app the text has no padding so the border fits very tight:

runtimeApp

Is there any way to make the border of the button fit a bit looser? I can't seem to make the UIButton bigger since it's in a stack view...

Upvotes: 1

Views: 177

Answers (2)

StackUnderflow
StackUnderflow

Reputation: 2463

You have to set a width constraint on the button.

Upvotes: 1

Nikhil Pandey
Nikhil Pandey

Reputation: 272

you can look at lowering the content hugging priority of the add button as both are UIButtons and have same compression resistance and content hugging priority and stack view algorithm in such cases stretches the leftmost view.

Upvotes: 1

Related Questions