I'm working on an iOS/iPadOS app that looks fine in the Xcode simulator but has a nasty difference when run on a real device.
For example, I set a UINavigationBar title on my Settings screen as follows:
Here's how the top of the iPad screen looks in the simulator:
Here's how it looks on a real iPad when connected to my Mac and run via the simulator:
And here's how it looks if I stop running the simulator and launch it independently on the iPad. As you can see, the black text gets a black background, making it unreadable.
Black text in a UITableView (on a white background) also turns to black-on-black and becomes unreadable. Example:
UIButtons with the "Filled" style have white text on a blue background in the simulator, but running directly on the iPad they have white text with a black background, inside a frame of blue. Example in the simulator:
On a real device:
Even some third-party custom views I'm using get black backgrounds.
I've tried running the app on each possible simulated device, and they all work correctly, as the app is designed to look. I've tried running the app on several real devices, and every one has the black background problem. Updating to the latest iOS/iPadOS didn't resolve it. I don't have any special "accessibility" settings turned on.
I've tried tinkering with the properties of these various views, like changing background colors from Default to Clear, but no change of properties makes the behavior change.
Any ideas?
For example, I set a UINavigationBar title on my Settings screen as follows:
Code:
self.navigationItem.title = "Settings"
Here's how the top of the iPad screen looks in the simulator:
Here's how it looks on a real iPad when connected to my Mac and run via the simulator:
And here's how it looks if I stop running the simulator and launch it independently on the iPad. As you can see, the black text gets a black background, making it unreadable.
Black text in a UITableView (on a white background) also turns to black-on-black and becomes unreadable. Example:
UIButtons with the "Filled" style have white text on a blue background in the simulator, but running directly on the iPad they have white text with a black background, inside a frame of blue. Example in the simulator:
On a real device:
Even some third-party custom views I'm using get black backgrounds.
I've tried running the app on each possible simulated device, and they all work correctly, as the app is designed to look. I've tried running the app on several real devices, and every one has the black background problem. Updating to the latest iOS/iPadOS didn't resolve it. I don't have any special "accessibility" settings turned on.
I've tried tinkering with the properties of these various views, like changing background colors from Default to Clear, but no change of properties makes the behavior change.
Any ideas?