Last active
September 5, 2022 16:04
-
-
Save christianselig/363c38e7c1e5d22bea8eeede5d3968c7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct ContentView: View { | |
let text1 = "Hello this is some very long text that goes on for quite awhile which can make it tricky to display" | |
let text2 = "I am brief" | |
var body: some View { | |
Color.black.opacity(0.2) | |
.frame(width: 180.0, height: 60.0) | |
.overlay( | |
VStack(alignment: .leading, spacing: 0.0) { | |
Text(text1) | |
.font(.system(size: 12.0, weight: .semibold)) | |
Spacer(minLength: 0.0) | |
// .frame(minHeight: 0.0, maxHeight: 10.0) | |
Text("Buy My Ice Cream") | |
.font(.caption.italic()) | |
} | |
) | |
} | |
} | |
struct ContentView_Previews: PreviewProvider { | |
static var previews: some View { | |
ContentView() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here you go: