Why won't text on a label show up on an actual device but will in the simulator? (Xcode)

大憨熊 提交于 2021-01-29 11:25:53

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!