From d61f187614cfef9359d70ed22bcfcf887ce65586 Mon Sep 17 00:00:00 2001 From: Tim Miller Date: Fri, 11 Mar 2022 03:05:59 -0500 Subject: [PATCH] Update code-behind templates to correctly support Dark Mode, bind text to the center of the screen (#14367) --- .../maccatalyst/AppDelegate.cs | 4 ++-- dotnet/Templates/Microsoft.iOS.Templates/ios/AppDelegate.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dotnet/Templates/Microsoft.MacCatalyst.Templates/maccatalyst/AppDelegate.cs b/dotnet/Templates/Microsoft.MacCatalyst.Templates/maccatalyst/AppDelegate.cs index 763270edea46..7b90fc82e355 100644 --- a/dotnet/Templates/Microsoft.MacCatalyst.Templates/maccatalyst/AppDelegate.cs +++ b/dotnet/Templates/Microsoft.MacCatalyst.Templates/maccatalyst/AppDelegate.cs @@ -15,9 +15,9 @@ public override bool FinishedLaunching (UIApplication application, NSDictionary // 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!" + Text = "Hello, Catalyst!", + AutoresizingMask = UIViewAutoresizing.All, }); Window.RootViewController = vc; diff --git a/dotnet/Templates/Microsoft.iOS.Templates/ios/AppDelegate.cs b/dotnet/Templates/Microsoft.iOS.Templates/ios/AppDelegate.cs index f49c7da7245d..239f875381af 100644 --- a/dotnet/Templates/Microsoft.iOS.Templates/ios/AppDelegate.cs +++ b/dotnet/Templates/Microsoft.iOS.Templates/ios/AppDelegate.cs @@ -15,9 +15,9 @@ public override bool FinishedLaunching (UIApplication application, NSDictionary // 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, iOS!" + Text = "Hello, iOS!", + AutoresizingMask = UIViewAutoresizing.All, }); Window.RootViewController = vc;