swift 导航栏

        // 设置导航栏的背景颜色
        self.navigationController?.navigationBar.barTintColor = UIColor.rgb(65, green: 158, blue: 255)
        self.navigationController?.navigationBar.isTranslucent = false

        // 导航栏标题字体颜色
        self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white]
        
        // 导航栏按钮字体颜色
        self.navigationController?.navigationBar.tintColor = UIColor.white

        // 隐藏导航栏底部的线
        self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
        self.navigationController?.navigationBar.shadowImage = UIImage()

你可能感兴趣的:(swift 导航栏)