Home > AI > IOS > SwiftUI >

ZStack

Example 1:

struct TestView: View {
    var body: some View {
        ZStack(alignment: .top) {
            Image(systemName: "pencil")
                .resizable()
                .aspectRatio(contentMode: .fit)
            Text("Hacking with Swift")
                .font(.largeTitle)
                .background(Color.black)
                .foregroundColor(.white)
        }
    }
}

Leave a Reply