rubymotion的入门知识点
访问量: 2740
1。 有个 app_delegate. 作为程序入口
2. 在 app_delegate中,要有个rootview controller.
3. 每个 view controller, 都要继承 UIViewController.
看到 下面的代码,我想说:
1 class TapController < UIViewController 2 def viewDidLoad 3 super 4 self.view.backgroundColor = UIColor.redColor 5 6 @label = UILabel.alloc.initWithFrame CGRectZero 7 @label.text = 'hihihi' 8 @label.sizeToFit 9 @label.center = CGPointMake self.view.frame.size.width / 2, self.vie w.frame.size.height / 2 10 self.view.addSubview @label 11 end 12 end
呵呵