问题
Running : - Latest version of Xcode - Catalina 10.15.2 - Base model MacBook Pro 13 inch
I'm having an issue where when I have text in a label show up on the simulator but when I try running it on my iPad, it is just blank. The text is currently being shown on the simulator because that is what I have just typed in on the label on the main.storyboard.
I have tried setting the label text manually by doing myLabel.text = "myText"
but that didn't work either. Each device is up to date in terms of the software and I have chosen iOS 13/iPad OS for what software the simulator should run on also. I'm thinking it is just some weird iOS 13 bug because I can't find a fix for it.
On iPad
on Simulator
回答1:
Please check if Dark mode
is enabled
or not on the actual device, if it is then try changing the color of the text to something else like: BlackColor
because if the text color is labelColor
then on devices with dark mode enabled it will appear white
.
来源:https://stackoverflow.com/questions/59525852/why-wont-text-on-a-label-show-up-on-an-actual-device-but-will-in-the-simulator