【问题标题】:How do I change the size of text?如何更改文本的大小?
【发布时间】:2021-05-12 07:40:17
【问题描述】:

我不知道如何更改文本大小。我可以将字体更改为 .largeTitle,但这与文本一样大。

【问题讨论】:

标签: ios swift


【解决方案1】:

如果您使用的是 UIKit:

label.font = UIFont.systemFont(ofSize: 10, weight: .medium)

如果您使用的是 SwiftUI:

Text("something")
.font(.system(size: 10, weight: .light))

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-10-06
    • 2018-01-18
    • 1970-01-01
    • 2020-05-13
    • 2017-05-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多