2014-01-23 67 views
1

我试图改变状态栏的这样 enter image description here更改状态栏的背景rubymotion

的背景,但任何尝试失败,我不知道我是否用得好好方法。

约束是navigationBar应该隐藏,我不能这样做,我不知道是否因为ca我无法更改statusBar的背景。

谢谢

回答

1

我要this StackOverflow answer和适应它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 
+1

你可以用self.view.addSubview(视图)取代self.window.rootViewController.view.addSubview(视图),如果你把这个在视图控制器;在这种情况下,您可以为每个VC自定义背景 –