UITabBar的颜色设置

2016-07-28  本文已影响40人  张宇航_Ken

UITabBar默认的前景色是蓝色,背景是半透明的白色。为了配合app的主题颜色,我们需要修改这两个颜色值。如图:

Custom Color.png

背景色可以在IB上直接改(注意:是Bar Tint项而不是Background项)


Bar Tint Color.png

前景色需要在代码中改

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
  UITabBar.appearance().tintColor = UIColor.whiteColor()
  return true
}
上一篇下一篇

猜你喜欢

热点阅读