xamarin-macios/dotnet/Microsoft.MacCatalyst.Templ.../maccatalyst/AppDelegate.cs

33 строки
802 B
C#
Исходник Обычный вид История

using Foundation;
using UIKit;
namespace MacCatalystApp1 {
[Register ("AppDelegate")]
public class AppDelegate : UIApplicationDelegate {
public override UIWindow Window {
get;
set;
}
public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions)
{
// create a new window instance based on the screen size
Window = new UIWindow (UIScreen.MainScreen.Bounds);
// create a UIViewController with a single UILabel
var vc = new UIViewController ();
vc.View.AddSubview (new UILabel (Window.Frame) {
BackgroundColor = UIColor.White,
TextAlignment = UITextAlignment.Center,
Text = "Hello, Catalyst!"
});
Window.RootViewController = vc;
// make the window visible
Window.MakeKeyAndVisible ();
return true;
}
}
}