How to apply .italic() to .largeTitle Font?

2020-04-21 08:16发布

问题:

import SwiftUI
import PlaygroundSupport

struct ContentView: View {

    var body: some View {

        VStack {
            ForEach(Font.TextStyle.allCases, id: \.self) { style in
                Text(self.describe(style: style)).font(.system(style)).italic()
            }
        }
    }
    func describe(style: Font.TextStyle) -> String {
        var s: String = ""
        print(style, terminator: "", to: &s)
        return s
    }
}

PlaygroundPage.current.setLiveView(ContentView())

produce

is it a bug or I missed something?

回答1:

Final answer from Apple

Resolution:Investigation complete - Works as currently designed

Have a lot of fun with Apple ...



标签: swiftui-bug