我试图在SwiftUI中将文本更改为小写字母。
但是我不明白如何将“方法”应用于我的文本。
https://developer.apple.com/documentation/swiftui/font/3084273-smallcaps
我尝试了不同的方法,这是其中两种:
Text("Typography")
.font(.system(size: 24))
.fontWeight(.bold)
.smallCaps()
--
Text("Typography")
.font(.system(.body, textStyle: .smallCaps))
如何设置字母大写?
我正在使用Xcode 11.3。
谢谢!
最佳答案
该代码终于为我工作:
Text("Typography")
.font(Font.system(.body).smallCaps())
关于ios - 在SwiftUI中使用.smallCaps(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60960818/