【发布时间】:2015-05-03 15:06:24
【问题描述】:
self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
var nav1 = UINavigationController()
var first = ViewController(nibName: nil, bundle: nil)
nav1.viewControllers = [first]
var second = ccDiscovery(nibName: nil, bundle: nil)
var nav2 = UINavigationController()
nav2.viewControllers = [second]
var third = ccPosting(nibName: nil, bundle: nil)
var nav3 = UINavigationController()
nav3.viewControllers = [third]
var fourth = ccProfile(nibName: nil, bundle: nil)
var nav4 = UINavigationController()
nav4.viewControllers = [fourth]
var tabs = UITabBarController()
tabs.viewControllers = [nav1, nav2,nav3,nav4]
self.window!.rootViewController = tabs;
self.window?.makeKeyAndVisible();
如何在 App delegate 中为UItabBar 添加图标图像和图像背景?我找不到。
UITabBarItem.appearance().setTitleTextAttributes([NSForegroundColorAttributeName: UIColor.magentaColor()], forState:.Normal)
UITabBarItem.appearance().setTitleTextAttributes([NSForegroundColorAttributeName: UIColor.redColor()], forState:.Selected)
【问题讨论】:
标签: ios xcode swift uitabbarcontroller