malkomalko
6/11/2013 - 12:42 PM

app_delegate.rb

class AppDelegate
  
  def application(application, didFinishLaunchingWithOptions:launchOptions)
    # ...
    navigation_appearance
    #...
  end

  def navigation_appearance
    # Background Color
    UINavigationBar.appearance.setBackgroundImage UIImage.alloc.init, # use an empty image
      forBarMetrics: UIBarMetricsDefault
    UINavigationBar.appearance.setBackgroundColor "#3076B4".to_color
    # Remove Shadow
    UINavigationBar.appearance.setShadowImage UIImage.alloc.init # use an empty image

    UINavigationBar.appearance.setTitleTextAttributes({
      UITextAttributeTextColor => UIColor.whiteColor,
      UITextAttributeTextShadowColor => UIColor.clearColor,
      UITextAttributeTextShadowOffset =>  NSValue.valueWithUIOffset(UIOffsetMake(0,0)),
      UITextAttributeFont => UIFont.fontWithName("Lato-Regular", size: 20)
    })
  end

end