0

Please consider following code:

let addTo: UIButton = {
        let btn = UIButton()
        btn.titleLabel?.textAlignment = .center
        btn.titleLabel?.font = Theme.Font.sixteen.reqular
        btn.setTitle(LocalizedStrings.addTo.value, for: .normal)
        btn.setTitleColor(Theme.Color.blue, for: .normal)
        btn.contentVerticalAlignment = .top
        btn.contentHorizontalAlignment = .center
        btn.titleEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 0)
        return btn
    }()

enter image description here

What i want is, to remove top and bottom spacing. Because i want to configure it manually.

I went here but folks suggest to manually set offset to 10 using UIEdgeInsetsMake. Is there solution like - say to button that we dont want vertical offsets? Thanks

Evgeniy Kleban
  • 6,794
  • 13
  • 54
  • 107

0 Answers0