iOS Swift 맵 라이브러리 요약 UITObBar·UITObBarItem 편
설계
TabBar의 선을 지웁니다.
tabBar.shadowImage = UIImage()
TabBar 색상 변경
tabBar.barTintColor = UIColor.blue
TabBarItem 선택 색상 변경
tabBar.tintColor = UIColor.purple
TabBarItem의 비선택 색상 변경(iOS 10.0 이후)
tabBar.unselectedItemTintColor = UIColor.white
배치 표시
// 一つ目のタブにバッヂを表示
tabBar.items!.first?.badgeValue = "バッヂ"
일괄 색상 변경
tabBar.items!.first?.badgeColor = UIColor.purple
나타내다
TabBarController 표시
let firstVC = UIViewController()
firstVC.view.backgroundColor = UIColor.orange
firstVC.tabBarItem = UITabBarItem(tabBarSystemItem: .bookmarks, tag: 1)
let secondVC = UIViewController()
secondVC.view.backgroundColor = UIColor.blue
secondVC.tabBarItem = UITabBarItem(tabBarSystemItem: .downloads, tag: 2)
let tabBarController = UITabBarController()
tabBarController.setViewControllers([firstVC, secondVC], animated: false)
present(tabBarController, animated: true, completion: nil)
조작하다
탭
tabBarController?.selectedIndex = 2
탭을 눌렀을 때 모드 보이기
class TabViewController: UITabBarController, UITabBarControllerDelegate {
override func viewDidLoad() {
super.viewDidLoad()
self.delegate = self
}
func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool {
///
if viewController is タブに設定されているViewControllerのClassを指定 {
let modalVC = UIViewController()
modalVC.view.backgroundColor = UIColor.purple
present(modalVC, animated: true, completion: nil)
return false
}
return true
}
}
navigationController에서 push할 때 TabBar 숨기기
hidesBottomBarWhenPushed = true
프로그램 라이브러리
TabBarItem 애니메이션 벌크 디스플레이, 범례 디스플레이, 기타 사용자 정의
eggswift/ESTabBarController
TabBarItem 애니메이션
Ramotion/animated-tab-bar
위 첨자 TabBar(1)
KrishnaPatell/KPSmartTabBar
위 첨자 TabBar(2)
xmartlabs/XLPagerTabStrip
위 첨자 TabBar(3)
EndouMari/TabPageViewController
태그 시리즈
tabBar.shadowImage = UIImage()
tabBar.barTintColor = UIColor.blue
tabBar.tintColor = UIColor.purple
tabBar.unselectedItemTintColor = UIColor.white
// 一つ目のタブにバッヂを表示
tabBar.items!.first?.badgeValue = "バッヂ"
tabBar.items!.first?.badgeColor = UIColor.purple
TabBarController 표시
let firstVC = UIViewController()
firstVC.view.backgroundColor = UIColor.orange
firstVC.tabBarItem = UITabBarItem(tabBarSystemItem: .bookmarks, tag: 1)
let secondVC = UIViewController()
secondVC.view.backgroundColor = UIColor.blue
secondVC.tabBarItem = UITabBarItem(tabBarSystemItem: .downloads, tag: 2)
let tabBarController = UITabBarController()
tabBarController.setViewControllers([firstVC, secondVC], animated: false)
present(tabBarController, animated: true, completion: nil)
조작하다
탭
tabBarController?.selectedIndex = 2
탭을 눌렀을 때 모드 보이기
class TabViewController: UITabBarController, UITabBarControllerDelegate {
override func viewDidLoad() {
super.viewDidLoad()
self.delegate = self
}
func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool {
///
if viewController is タブに設定されているViewControllerのClassを指定 {
let modalVC = UIViewController()
modalVC.view.backgroundColor = UIColor.purple
present(modalVC, animated: true, completion: nil)
return false
}
return true
}
}
navigationController에서 push할 때 TabBar 숨기기
hidesBottomBarWhenPushed = true
프로그램 라이브러리
TabBarItem 애니메이션 벌크 디스플레이, 범례 디스플레이, 기타 사용자 정의
eggswift/ESTabBarController
TabBarItem 애니메이션
Ramotion/animated-tab-bar
위 첨자 TabBar(1)
KrishnaPatell/KPSmartTabBar
위 첨자 TabBar(2)
xmartlabs/XLPagerTabStrip
위 첨자 TabBar(3)
EndouMari/TabPageViewController
태그 시리즈
tabBarController?.selectedIndex = 2
class TabViewController: UITabBarController, UITabBarControllerDelegate {
override func viewDidLoad() {
super.viewDidLoad()
self.delegate = self
}
func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool {
///
if viewController is タブに設定されているViewControllerのClassを指定 {
let modalVC = UIViewController()
modalVC.view.backgroundColor = UIColor.purple
present(modalVC, animated: true, completion: nil)
return false
}
return true
}
}
hidesBottomBarWhenPushed = true
TabBarItem 애니메이션 벌크 디스플레이, 범례 디스플레이, 기타 사용자 정의
eggswift/ESTabBarController
TabBarItem 애니메이션
Ramotion/animated-tab-bar
위 첨자 TabBar(1)
KrishnaPatell/KPSmartTabBar
위 첨자 TabBar(2)
xmartlabs/XLPagerTabStrip
위 첨자 TabBar(3)
EndouMari/TabPageViewController
태그 시리즈
Reference
이 문제에 관하여(iOS Swift 맵 라이브러리 요약 UITObBar·UITObBarItem 편), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/ebi-toro/items/298fb31c159a4cc75fcf텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)