I've created an HStack and am trying to make one of those titles that you find in Apple apps (Messages, Mail, etc.) at the top left. I've gotten the text to the right size, made it bold, and aligned to the left and used .frame(alignment: .top)
to align it to the top, but for some reason it stays in the middle. What am I doing wrong? Below is the code and an image of the issue.
import SwiftUI
struct HomeScreen: View {
var body: some View {
HStack{
Text("Tasks").font(.largeTitle).fontWeight(.bold).frame(maxWidth: .infinity, alignment: .leading).padding()
.frame(alignment: .top)
}
}
struct HomeScreen_Previews: PreviewProvider {
static var previews: some View {
HomeScreen()
}
}
}

For some reason, screenshot does not show.
For some reason, screenshot doesn't show.