Created
October 4, 2011 07:56
-
-
Save chrisbranson/1261104 to your computer and use it in GitHub Desktop.
Xibless Monotouch example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Drawing; | |
using MonoTouch.Foundation; | |
using MonoTouch.UIKit; | |
namespace XibLess | |
{ | |
public class Application | |
{ | |
static void Main (string[] args) | |
{ | |
try | |
{ | |
UIApplication.Main (args, null, "XibLessAppDelegate"); | |
} | |
catch (Exception ex) | |
{ | |
// any unhandled exceptions end up here | |
Console.WriteLine(ex); | |
} | |
} | |
} | |
[MonoTouch.Foundation.Register("XibLessAppDelegate")] | |
public partial class XibLessAppDelegate : UIApplicationDelegate | |
{ | |
UIWindow window; | |
UINavigationController navcontroller; | |
UIViewController viewcontroller; | |
UIView view; | |
public override void FinishedLaunching (UIApplication application) | |
{ | |
window = new UIWindow(); | |
navcontroller = new UINavigationController(); | |
viewcontroller = new UIViewController(); | |
viewcontroller.Title = "XibLess"; | |
view = new UIView(new RectangleF(0, 0, 320, 640)); | |
view.BackgroundColor = UIColor.Blue; | |
viewcontroller.Add(view); | |
navcontroller.PushViewController(viewcontroller, false); | |
window.AddSubview (navcontroller.View); | |
window.MakeKeyAndVisible (); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment