为什么会有两种蓝色阴影?如何摆脱内部较浅的蓝色阴影?我希望整个按钮为单一纯色。
我看过.backgroundColor,以为可能是.foregroundColor,但是我找不到正在做的事情...
这是我正在使用的:
func buttonArrayUpdated(buttonSelected: UIButton) {
for b in buttonsArray {
if b == buttonSelected {
selectedButton = b
b.isSelected = true
// default colors for state
b.backgroundColor = .blue
b.setTitleColor(.white, for: .selected)
}
else {
b.isSelected = false
// default colors for state
b.backgroundColor = .white
b.setTitleColor(.blue, for: .normal)
}
}
}
答案 0 :(得分:1)
您可以执行以下操作以删除该背景色:
button.tintColor = .clear