HomeiOS DevelopmentMethods to apply nook radius to a Native glass effected UIButton?

Methods to apply nook radius to a Native glass effected UIButton?


What i need:

Methods to apply nook radius to a Native glass effected UIButton?

What i’ve: (iOS 26.0)

What i have: (iOS 26.0)

in decrease model of iOS(<26.0) is working good as connect screenshot above however when i run the app on iOS 26.0 it is not utilized .glasseffect however when utilized nook radius to it it is not working for me.

Query

  1. Is that this attainable to use nook radius to UIButton with glass impact?

NOTE: I do not need to use UIVisualEffectView i need to use native glass impact of iOS26.

What i attempted:

        if #out there(iOS 26.0, *) {
            var config = UIButton.Configuration.clearGlass()
            config.background.cornerRadius = 5
            btnMaximise.configuration = config
        } else {
            btnMaximise.backgroundColor = .white
        }
        btnMaximise.layer.cornerRadius = 5
        btnMaximise.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner]
        btnMaximise.layer.masksToBounds = true
        btnMaximise.addTarget(self, motion: #selector(didTapMaximise), for: .touchUpInside)
        
        if #out there(iOS 26.0, *) {
            var config = UIButton.Configuration.clearGlass()
            config.background.cornerRadius = 5
            btnMinimise.configuration = config
        } else {
            btnMinimise.backgroundColor = .white
        }
        btnMinimise.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner]
        btnMinimise.layer.cornerRadius = 5
        btnMinimise.layer.masksToBounds = true
        btnMinimise.addTarget(self, motion: #selector(didTapMinimise), for: .touchUpInside)

I get each time absolutely rounded nook whereas i solely utilized nook radius to five.0

I’m strictly use UIKit right here.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments