2024-11-27
首先要embed in Navigate Controller:
选中第一个界面 - Editor - embed in - Navigate Controller
添加元素bar button
改成名字-Logout
在viewDidLoad里面增加:
navigationItem.hidesBackButton = true
在viewDidLoad里面增加:
title = "⚡️FlashChat"
在AppDelegate的第一个func里面输入:
//全局样式-顶部菜单颜色
let appearance = UINavigationBarAppearance()
appearance.backgroundColor = UIColor(named: K.BrandColors.blue) // 设置背景色
// 设置标题字体和颜色
appearance.titleTextAttributes = [
.font: UIFont.systemFont(ofSize: 25, weight: .black), // 设置字号为28
.foregroundColor: UIColor.white // 设置颜色为白色
]
UINavigationBar.appearance().standardAppearance = appearance
UINavigationBar.appearance().scrollEdgeAppearance = appearance
UINavigationBar.appearance().compactAppearance = appearance