1

I try to change the background of the statusBar like this enter image description here

but any attempt fails and I do not know if I use well good method.

the constraint is that the navigationBar should be hidden and I can not do otherwise, and I do not know if it's because of ca that I can not change the background of the statusBar.

thank you

snollygolly
  • 1,858
  • 2
  • 17
  • 31
user1774481
  • 193
  • 3
  • 12

1 Answers1

1

I'll take this StackOverflow answer and adapt it for RubyMotion.

if UIDevice.currentDevice.systemVersion.to_f >= 7.0
  view = UIView.alloc.initWithFrame([[0, 0], [320, 20]])
  view.backgroundColor = UIColor.colorWithRed(0/255.0, green:0/255.0, blue:0/255.0, alpha:1.0)
  self.window.rootViewController.view.addSubview(view)
end
Community
  • 1
  • 1
Jamon Holmgren
  • 23,738
  • 6
  • 59
  • 75
  • 1
    You can replace self.window.rootViewController.view.addSubview(view) with self.view.addSubview(view) if you call this in a ViewController; in this case you can customize the background per VC – Michel Löhr Jan 29 '14 at 12:29