I filed a bug this morning on an iOS issue that showed up in 2021.1.28 (1.27 did not exhibit this issue). It escapes me how iOS light mode would have any affect on the content area of the Unity iOS player app.
I have just updated to Unity 2020.3.23 and having the exact same issue, suddenly my complete game color’s change when using light mode - where it should always look like in dark mode !? How can I change this ?
Was able to fix it when using Appearance = “Dark” plist parameter in Xcode to force the game to “Dark” mode. But this was never necessary before and I think this should not affect the unity player… ! Also interesting why I needed the dark mode for my game and everything was wrong with “Light” mode …
Hey - I noticed this too with my latest iOS build on 2020.3.23f1. The app will not render any black colors when the iOS Appearance setting is set to Light. When I set it to Dark under Settings > Display & Brightness then my app looks correct.
How do I add that Appearance = “Dark” in the plist? I have never touched the plist file.
In Xcode under the “info” tab - there are many parameters (line by line) … there you can add one with the little + and then enter Apperance and for the value use “Dark” - that forces the app to use the dark mode
So I’m trying to automate the adding of the Appearance entry to my plist but it only partially works.
It is added to my Xcode projects plist but it doesn’t force my game to run in dark mode. If I add it manually in Xcode it works.
#if UNITY_IOS
using System.IO;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
public static class iOSOnPostprocessBuild
{
[PostProcessBuild(100)]
public static void OnPostprocessBuild(BuildTarget target, string pathToBuildProject)
{
if (target == BuildTarget.iOS)
{
var plistPath = Path.Combine(pathToBuildProject, "Info.plist");
var plist = new PlistDocument();
plist.ReadFromString(File.ReadAllText(plistPath));
plist.root.SetString("Appearance", "Dark");
File.WriteAllText(plistPath, plist.WriteToString());
}
}
}
#endif
You can see that when I add the Appearance entry via code the string label isn’t greyed out but it is when I enter it manually. Can someone please tell me why my code doesn’t work?
Yes snorrsi is right Appearance is just a synonym for UIUserInterfaceStyle - for now I am just doing it manually in XCode upon release and hope that at some point Unity resolves it… because this is definitely a bug