I have a Horizontal StackView
. Later I add 2 views: UILabel
& UIButton
.
Current problem: UILabel
only takes minimum width, it only takes enough width to show text, UIButton
take the rest.
Expected result:
UILabel
take much width as possible while UIButton
only take enough width to show its text.
I tried to add left constraint for UILabel
, right for UIButton
but no luck.
What i tried:
Option 1: Fix the
UIButton
width, thenUILabel
takes the rest, but not good in multi language.Option 2: Let
UIButton
takes the width, but set its align to the right. But its limitation is clicking range too large.
Thanks!