自定义 UINavigationController
来源:互联网 发布:方太淘宝旗舰店 编辑:程序博客网 时间:2024/05/21 14:44
import Foundation
import UIKit
@objc
class BaseNavigationController: UINavigationController {
var childCtr: UIViewController?
override func viewDidLoad() {
self.navigationBar.hidden =true
if let ctr =childCtr {
self.addChildViewController(ctr)
}
}
override func popViewControllerAnimated(animated: Bool) -> UIViewController? {
ifself.childViewControllers.count ==1 {
dismissViewControllerAnimated(true, completion:nil)
return nil
}else {
returnsuper.popViewControllerAnimated(animated)
}
}
func addBasicChildViewController(ctr:UIViewController) {
self.childCtr = ctr
}
}
//状态栏的颜色
import Foundation
import UIKit
class BaseLightNavigationController: BaseNavigationController {
//调整statusbar颜色
override func preferredStatusBarStyle() ->UIStatusBarStyle {
returnUIStatusBarStyle.LightContent
}
}
//使用
let ctr =viewCotroller()
let navController = BaseLightNavigationController()
navController.childCtr = ctr
self.presentViewController(navController, animated:true, completion: nil)
- UINavigationController 自定义
- 自定义 UINavigationController
- 自定义 UINavigationController
- 自定义UINavigationController背景
- UINavigationController 自定义动画
- 自定义UINavigationController背景
- 自定义UINavigationController背景
- UINavigationController 自定义动画
- 自定义UINavigationController(导航控制器)
- UINavigationController 自定义弹窗
- 自定义UINavigationController 切换动画
- iOS 自定义UINavigationController
- iOS UINavigationController 自定义设置
- 诡异事件之自定义UINavigationController
- 自定义UINavigationController导航栏背景
- UInavigationcontroller的颜色自定义修改
- iOS 自定义UINavigationController和UITabBarController
- iOS 自定义导航控制器UINavigationController
- hdu-1348 Wall(凸包)
- PCA原理及人脸识别
- 设计模式(三)装饰模式
- 列表解析(list comprehension) 与三目运算符
- 百度地图之覆盖物
- 自定义 UINavigationController
- UVa 136 Ugly Numbers
- pdb命令行调试Python代码
- <a>元素也能玩出新鲜样儿
- jsp编译原理
- SecureCRT满屏后如何设置不自动清除
- C++函数中参数的传递
- 设计模式:观察者模式
- 设计模式——命令模式