如何刪除左側padding
從UIButton
?如何從UIButton中刪除左邊距?
我已創建按鈕,使用此代碼:
let button = UIButton(...)
button.setImage(UIImage(named: "plus")?.withRenderingMode(.alwaysTemplate), for: .normal)
button.setTitle("Text", for: .normal)
button.layer.cornerRadius = 8
button.layer.backgroundColor = UIColor.red.cgColor
簡單的button.setTitle(「+ Text」)是否有效? (又名,沒有嵌入真實圖像) – Vexy