简体   繁体   English

如何在 Swift 中实现 SF Pro 圆形文本?

[英]How can I implement SF Pro Rounded text in Swift?

Below is the code on which I am trying to implement SF pro-rounded text in Swift.下面是我试图在 Swift 中实现 SF pro-rounded 文本的代码。 I am new to Swift and am not entirely sure how to edit fonts.我是 Swift 的新手,我不完全确定如何编辑 fonts。 Text("Levitate").font(.largeTitle).fontWeight(.semibold).foregroundColor(Color.white).multilineTextAlignment(.center) Text("悬浮").font(.largeTitle).fontWeight(.semibold).foregroundColor(Color.white).multilineTextAlignment(.center)

You want this: https://developer.apple.com/documentation/swiftui/font/system(_:design:weight:)你想要这个: https://developer.apple.com/documentation/swiftui/font/system(_:design:weight:)

Eg:例如:

Text("My text")
    .font(.system(.largeTitle, design: .rounded, weight: .semibold))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM