Ios 按钮上有两种颜色(swift)

Ios 按钮上有两种颜色(swift),ios,swift,Ios,Swift,未选中的按钮如下所示: 所选按钮如下所示: 为什么有两种深浅的蓝色?我怎样才能去掉里面的淡蓝色?我想整个按钮是一个单一的纯色 我已经看过了。背景色,认为可能有。背景色,但我找不到是什么在起作用 以下是我正在使用的: func buttonArrayUpdated(buttonSelected: UIButton) { for b in buttonsArray { if b == buttonSelected { selectedButton =

未选中的按钮如下所示:

所选按钮如下所示:

为什么有两种深浅的蓝色?我怎样才能去掉里面的淡蓝色?我想整个按钮是一个单一的纯色

我已经看过了。背景色,认为可能有。背景色,但我找不到是什么在起作用

以下是我正在使用的:

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)
        }
    }
}

您可以执行以下操作以删除该背景色:

 button.tintColor = .clear

您显示的图像不是来自默认的
ui按钮
。。。显示用于更改按钮外观的代码。