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 model however was stunned to seek out the button spotlight state is barely noticeable. Whenever you faucet down on a conventional system button, its alpha decreases quite a bit to point it’s being pressed, so it’s straightforward to know whenever you launch the contact this button might be triggered. Sadly with the plain button configuration, the spotlight state is difficult to see as a result of the looks barely modifications. Is there a technique to make this spotlight behave like all the opposite buttons corresponding to UIBarButtonItem
s?
let oldButton = UIButton(sort: .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: