我正在尝试找到一种获取 aList标题的系统字体的好方法。这就是我的意思:
struct ContentView: View {
var body: some View {
List {
Section(header: Text("Test")) {
Text("Blablabla")
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
基本上,有没有办法以编程方式获取图像中显示“测试”的文本的字体Text,例如,我可以在对象的其他地方使用它?
I'm font of the trying to make a collapsible header by using DisclosureGroup, however the font of the DisclosureGroup is different from the font of the Section.
另一种方法是提供您想要的字体,然后在您想要的任何地方使用它,这很有趣:
Text("Test").font(.largeTitle)
Text("Test").font(.system(size:34))
Text("Test").font(.system(size: 20, weight: .bold, design: .serif)))
Text("Test").font(Font.custom("Wingdings", size: 30.0))
Text("Test").font(Font.custom("Montserrat-Bold", size: 30.0))
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
167 次 |
| 最近记录: |