问题描述
在Xcode中显示Text文本时报如下错误:
No exact matches in call to initializer
经查询发现问题为Text视图只接受String类型的值,因此需要将selectedNumber字段转为字符串才能显示。
解决方案
使用插值的方式,将selectedNumber由Number类型转换为String类型。
Text(selectedNumber)
在Xcode中显示Text文本时报如下错误:
No exact matches in call to initializer
经查询发现问题为Text视图只接受String类型的值,因此需要将selectedNumber字段转为字符串才能显示。
使用插值的方式,将selectedNumber由Number类型转换为String类型。
Text(selectedNumber)
如果您认为这篇文章给您带来了帮助,您可以在此通过支付宝或者微信打赏网站开放者。