答案 0 :(得分:0)
导航栏的高度固定为65,状态栏。 但是如果你想改变导航条的高度,你可以采取以下替代方式。
let height: CGFloat = 50 //whatever height you want to add to the existing height
let bounds = self.navigationController!.navigationBar.bounds
self.navigationController?.navigationBar.frame = CGRect(x: 0, y: 0, width: bounds.width, height: bounds.height + height)
并设置字体。
if (UIDevice.currentDevice().userInterfaceIdiom == UIUserInterfaceIdiom.Pad)
{
UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName :NavigationColor,
NSFontAttributeName: FontLight_40
]
UIBarButtonItem.appearance().setTitleTextAttributes([NSFontAttributeName:FontLight_40], for: UIControlState.normal)
}
else
{
UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName :NavigationColor,
NSFontAttributeName: FontLight_20
]
UIBarButtonItem.appearance().setTitleTextAttributes([NSFontAttributeName:FontLight_20], for: UIControlState.normal)
}