London Escorts sunderland escorts 1v1.lol unblocked yohoho 76 https://www.symbaloo.com/mix/yohoho?lang=EN yohoho https://www.symbaloo.com/mix/agariounblockedpvp https://yohoho-io.app/ https://www.symbaloo.com/mix/agariounblockedschool1?lang=EN
-0.4 C
New York
Monday, February 3, 2025

ios – Find out how to make UIButton.Configuration spotlight look match that of system buttons


I am modernizing my app and updating UIButtons 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 UIBarButtonItems?

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:

enter image description here

That is the spotlight state of the plain button:

enter image description here

Related Articles

Social Media Auto Publish Powered By : XYZScripts.com