Jinsujin / SwiftUI

SwiftUI를 공부해보고 활용하는 공간
0 stars 0 forks source link

Image #3

Closed Jinsujin closed 1 year ago

Jinsujin commented 1 year ago

문서 바로가기

Image 를 보여주는 방법들

  1. Asset Image

    Image("이미지 이름")
        .resizable()
        .aspectRatio(contentMode: .fill)
        .frame(width: 200, height: 200)
        .clipped()
        .background(.orange)
    Image("이미지 이름")
        .resizable()
        .scaledToFill() // .aspectRatio(contentMode: .fill) 와 동일한 효과
        .frame(width: 200, height: 200)
  2. System symbol image

    Image(systemName: "heart.fill")
        .resizable()
        .aspectRatio(contentMode: .fit)
        .frame(width: 100, height: 100)