标签: ios swift button uibutton touch
我的按钮通常不会注意到触摸。一些原因?
let button = UIButton(type: .system) button.translatesAutoresizingMaskIntoConstraints = false
答案 0 :(得分:1)
将按钮的translatesAutoresizingMaskIntoConstraints属性设置为true:button.translatesAutoresizingMaskIntoConstraints = true
button.translatesAutoresizingMaskIntoConstraints = true