Last Updated: February 25, 2016
·
2.093K
· diogoandre

Globally set Status Bar Style in iOS 7 with RubyMotion

It is quite simple but it took me a few minutes to figure out. This is how you globally set your Status Bar style with RubyMotion:

First, in your Rakefile, within of your App.setup block:

app.info_plist['UIViewControllerBasedStatusBarAppearance'] = false

Then, in your app_delegate.rb:

class AppDelegate
  def application(application, didFinishLaunchingWithOptions:launchOptions)
    application.setStatusBarStyle(UIStatusBarStyleLightContent)
    true
  end
end

The style options you have are:

  1. UIStatusBarStyleDefault
  2. UIStatusBarStyleLightContent

All others were deprecated in iOS 7.0

4 Responses
Add your response

Thanks for the tip!

Typo in the AppDelegate above, change: "app.set..." to "application.set..."

over 1 year ago ·

Fixed the typo. Thanks!

over 1 year ago ·

Good one, Martin! But I only had luck with app.status_bar_style = :light_content in the rakefile. Anything else breaks the build.

over 1 year ago ·

BubbleWrap just needs that line in Rakefile and this in the controller:
App.shared.setStatusBarStyle 1

;)

over 1 year ago ·