2

我试图在 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。

谢谢!

4

1 回答 1

9

该代码终于对我有用:

Text("Typography")
    .font(Font.system(.body).smallCaps())
于 2020-03-31T22:30:31.290 回答