Home > AI > IOS > SwiftUI >

Alignment

Example :

struct ContentView: View {

    var body: some View {
//        SlideSideMenuView()
        
        ZStack(alignment: Alignment(horizontal: .leading, vertical: .center)) {
            Text("First View")
                .frame(width: 200, height: 200)
                .background(Color.orange)
            
            Text("Second View")
                .frame(width: 100, height: 100)
                .background(Color.blue)
        }
    }
}

Leave a Reply