mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-24 04:46:05 +08:00
update samples to use UIControllers (because otherwise a warning is printed in iOS 5.0)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
class MyView < UIView
|
||||
class HelloView < UIView
|
||||
def drawRect(rect)
|
||||
if @moved
|
||||
bgcolor = begin
|
||||
@@ -32,11 +32,18 @@ class MyView < UIView
|
||||
end
|
||||
end
|
||||
|
||||
class HelloViewController < UIViewController
|
||||
def loadView
|
||||
self.view = HelloView.alloc.init
|
||||
end
|
||||
end
|
||||
|
||||
class AppDelegate
|
||||
def application(application, didFinishLaunchingWithOptions:launchOptions)
|
||||
window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
|
||||
view = MyView.alloc.initWithFrame(window.frame)
|
||||
window.addSubview(view)
|
||||
window.rootViewController = HelloViewController.alloc.init
|
||||
window.rootViewController.wantsFullScreenLayout = true
|
||||
window.makeKeyAndVisible
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user