For some reason my UIButtons aren't appearing in my ruby motion apps. Only the button text appears.
Here's the code:
@containerView = UIView.alloc.initWithFrame([[0, 50], [self.view.frame.size.width, 100]])
@loginButton = UIButton.buttonWithType(UIButtonTypeRoundedRect)
@loginButton.frame = [[(self.view.frame.size.width / 2) + 5, 65], [(self.view.frame.size.width / 2) - 15, 40]]
@loginButton.setTitle('Login', forState: UIControlStateNormal)
@loginButton.addTarget(self,
action:'login',
forControlEvents:UIControlEventTouchUpInside)
@containerView.addSubview(@loginButton)
self.view.addSubview(@containerView)
I'm using RubyMotion v2.16, Promotion 1.0.4, sugarcube 1.3.5, motion layout 0.0.1 and bubblewrap 1.4.0
I've tried to render the buttons using the promotion way, the sugarcube way and the bubblewrap way but decided to break it down to the raw rubymotion way (above) for troubleshooting in a regular view controller. Any ideas on this one?
Well, if anyone else is reading outdated documentation also, it turns out that UIButtonTypeRoundedRect has been deprecated in iOS7.