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'] = falseThen, in your app_delegate.rb:
class AppDelegate
  def application(application, didFinishLaunchingWithOptions:launchOptions)
    application.setStatusBarStyle(UIStatusBarStyleLightContent)
    true
  end
endThe style options you have are:
- UIStatusBarStyleDefault
- UIStatusBarStyleLightContent
All others were deprecated in iOS 7.0
Written by Diogo
Related protips
4 Responses
 
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
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
 #Ios7 
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#
 
 
 
