问题描述
运行:- 最新版本的 Xcode- 卡特琳娜 10.15.2- 基本型号 MacBook Pro 13 英寸
Running : - Latest version of Xcode - Catalina 10.15.2 - Base model MacBook Pro 13 inch
我遇到了一个问题,当我在模拟器上显示标签中的文本时,但当我尝试在 iPad 上运行它时,它只是空白.该文本目前正在模拟器上显示,因为这是我刚刚在 main.storyboard 上的标签上输入的内容.
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.
我尝试通过执行 myLabel.text = "myText"
手动设置标签文本,但这也不起作用.每个设备在软件方面都是最新的,我选择了 iOS 13/iPad 操作系统作为模拟器应该运行的软件.我认为这只是一些奇怪的 iOS 13 错误,因为我找不到解决方法.
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.
在 iPad 上
在模拟器上
推荐答案
请检查Dark mode
是否在实际设备上enabled
,如果是则尝试将文本的颜色更改为其他颜色:BlackColor
因为如果文本颜色是 labelColor
那么在启用暗模式的设备上它将显示为 white
.
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
.
这篇关于为什么标签上的文字不会出现在实际设备上,而会出现在模拟器中?(Xcode)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!