This repository was archived by the owner on Apr 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathAppDelegate.cs
54 lines (44 loc) · 1.66 KB
/
AppDelegate.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using System;
using System.Collections.Generic;
using System.Linq;
using Foundation;
using UIKit;
namespace Working_with_images {
/// <summary>
/// The UIApplicationDelegate for the application. This class is responsible for launching the
/// User Interface of the application, as well as listening (and optionally responding) to
/// application events from iOS.
/// </summary>
[Register ("AppDelegate")]
public partial class AppDelegate : UIApplicationDelegate {
// class-level declarations
UIWindow window;
// Added controller. As of MonoTouch 5.0.2, applications are expected to
// have a root view controller at the end of application launch
UIViewController controller;
UILabel label;
/// <summary>
/// This method is invoked when the application has loaded and is ready to run. In this
/// method you should instantiate the window, load the UI into it and then make the window
/// visible.
/// </summary>
/// <remarks>
/// You have 5 seconds to return from this method, or iOS will terminate your application.
/// </remarks>
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
// create a new window instance based on the screen size
window = new UIWindow (UIScreen.MainScreen.Bounds);
controller = new UIViewController ();
controller.View.BackgroundColor = UIColor.White;
label = new UILabel ();
label.Frame = new CoreGraphics.CGRect (10, 10, UIScreen.MainScreen.Bounds.Width, 50);
label.Text = "Hello, Working with Images";
controller.View.AddSubview (label);
window.RootViewController = controller;
// make the window visible
window.MakeKeyAndVisible ();
return true;
}
}
}