0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

SwiftUI で 画像を表示する

Posted at

環境

  • macOS Monterey 12.2.1
  • Xcode Version 13.2.1 (13C100)
  • 使用する画像ファイル

目的

SwiftUI で画像を表示する

Image クラス

シンプルに画像を表示する

ContentView.swift
import SwiftUI

struct ContentView: View {
    var body: some View {
        VStack {
            Image("DSCN0575")
                .resizable()
                .scaledToFit()
                .frame(width: 300, height: 300)
        }
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?