Thursday, May 12, 2022
HomeiOS Developmentios - When i take advantage of edgesForExtendedLayout = my navigation...

ios – When i take advantage of edgesForExtendedLayout = [] my navigation bar not seem in transparently


i’m utilizing clear navigation bar, additionally i need to set my tableview content material under the navigation bar so i’m utilizing edgesForExtendedLayout, i can achieved tableview content material under navigation bar however navigation bar clear shouldn’t be working. It’s exhibiting With default white color background

i would like clear navigation bar in addition to edgesForExtendedLayout = [] each, is there any solution to obtain this ?

edgesForExtendedLayout = []

navigation bar clear code

let textAttributes = [NSAttributedString.Key.foregroundColor: UIColor.colorWhite()]
        navigationController?.navigationBar.tintColor = UIColor.colorWhite()
        navigationController?.navigationBar.backgroundColor = UIColor.clear
        navigationController?.navigationBar.isTranslucent = true

        if #out there(iOS 15, *) {
            let look = UINavigationBarAppearance()
            look.configureWithTransparentBackground()
            look.backgroundColor = .clear
            look.titleTextAttributes = textAttributes

            // Customizing our navigation bar
            navigationItem.standardAppearance = look
            navigationItem.scrollEdgeAppearance = look
        } else {
            navigationController?.navigationBar.titleTextAttributes = textAttributes
            navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
            navigationController?.navigationBar.shadowImage = UIImage()
        }

Thanks upfront

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments