专业java、php、iOS、C++、网页设计、平面设计、网络营销、游戏开发、前端与移动开发培训机构
添加导航栏按钮
/// 设置访客视图
private func setupVisitorView() {
// ...
// 添加导航栏按钮
navigationItem.leftBarButtonItem = UIBarButtonItem(title: "注册", style: UIBarButtonItemStyle.plain, target: self, action: #selector(vistorViewRegister))
navigationItem.rightBarButtonItem = UIBarButtonItem(title: "登录", style: UIBarButtonItemStyle.plain, target: self, action: #selector(vistorViewLogin))
}
设置全局外观
- 全局外观通常在
AppDelegate
中设置 - 在
AppDelegate
添加setupAppearance
方法/// 设置全局外观 private func setupAppearance() { UINavigationBar.appearance().tintColor = UIColor.orangeColor() }