LoginSignup
2
2

More than 3 years have passed since last update.

SwiftUIで画面の左上にビューを配置する方法

Posted at

import SwiftUI
import PlaygroundSupport

struct ContentView: View {
    var body: some View {
        VStack{
            HStack {
            Text("左上!")
                Spacer()
            }

                Spacer()
        }

    }

}

PlaygroundPage.current.liveView = UIHostingController(rootView: ContentView())

Spacer()を下と右に配置すれば良い。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2