5nl_qa
Last Updated: February 25, 2016
·
1.896K
· diogoandre
Caccedb9c5a2956a125c2489dde877c2

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

Say Thanks
Respond

4 Responses
Add your response

13905
C93b45c1b68f8230a9721404d3b67e9d

Thanks for the tip!

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

over 1 year ago ·
13907
Caccedb9c5a2956a125c2489dde877c2

Fixed the typo. Thanks!

over 1 year ago ·
13980
Caccedb9c5a2956a125c2489dde877c2

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 ·
17462
None

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

;)

over 1 year ago ·