I am modernizing my app and updating UIButton
s to make use of UIButton.Configuration
. I switched a system button to the default plain configuration type however was shocked to seek out the button spotlight state is barely noticeable. Whenever you faucet down on a standard system button, its alpha decreases rather a lot to point it’s being pressed, so it’s simple to know whenever you launch the contact this button can be triggered. Sadly with the plain button configuration, the spotlight state is tough to see as a result of the looks barely adjustments. Is there a approach to make this spotlight behave like all the opposite buttons reminiscent of UIBarButtonItem
s?
let oldButton = UIButton(kind: .system)
oldButton.setTitle("System Button", for: .regular)
oldButton.body = CGRect(x: 50, y: 100, width: 150, peak: 30)
view.addSubview(oldButton)
let newButton = UIButton(configuration: {
var config = UIButton.Configuration.plain()
config.title = "Plain Button"
return config
}())
newButton.body = CGRect(x: 50, y: 150, width: 150, peak: 30)
view.addSubview(newButton)
That is the spotlight state of the system button:
That is the spotlight state of the plain button: