Skip to content

Instantly share code, notes, and snippets.

@chrisbranson
Created October 4, 2011 07:56
Show Gist options
  • Save chrisbranson/1261104 to your computer and use it in GitHub Desktop.
Save chrisbranson/1261104 to your computer and use it in GitHub Desktop.
Xibless Monotouch example
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