iOS(swift)
[Swift 4] Fakebook 만들기 - 2. CollectionViewController, NavigationBar
광그로
2017. 11. 25. 01:00
#NavgationBar Color #NavgationBar Text Color #Storyboard Arrow #Initial View Controller
https://github.com/LeeGwangYong/iOS_swift/tree/master/FaceBook
참고 사이트 : https://www.youtube.com/watch?v=NJxb7EKXF3U&list=PL0dzCUj1L5JHDWIO3x4wePhD8G4d1Fa6N
1. CollectionViewController 추가하기
스토리보드의 모든 내용을 지우고 [Collection View Controller] 화면에 끌어다 놓기
2. NavigationBar 추가하기
ㄱ. Collectino View Controller 표시된 곳을 누르기
ㄴ. [Editor] - [Embed In] - [Navigation Controller]
ㄷ. 사라진 화살표 추가하기( Initial View Controller)
3. NavigationBar 색상, Text 색상 바꾸기
[info.plist]
[AppDelegate.swift]
1234567891011 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. UINavigationBar.appearance().barTintColor = UIColor(red: 51/255, green: 90/255, blue: 149/255, alpha: 1) UINavigationBar.appearance().tintColor = UIColor.white UINavigationBar.appearance().titleTextAttributes = [NSAttributedStringKey.foregroundColor:UIColor.white] application.statusBarStyle = .lightContent return true } cs
1 2 3 4 5 6 7 8 9 10 11 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. UINavigationBar.appearance().barTintColor = UIColor(red: 51/255, green: 90/255, blue: 149/255, alpha: 1) UINavigationBar.appearance().tintColor = UIColor.white UINavigationBar.appearance().titleTextAttributes = [NSAttributedStringKey.foregroundColor:UIColor.white] application.statusBarStyle = .lightContent return true } | cs |