0
0

More than 1 year has passed since last update.

【SwiftUI】画像を丸くクリッピングする

Posted at

こんな感じにしたい

simulator_screenshot_3020C2F7-B580-453C-946A-EFEB2362348D.png

実装

import SwiftUI

struct ContentView: View {
    var body: some View {
        Image("sample")
            .resizable()
            .scaledToFit()
            .frame(width: 100)
+           .clipShape(Circle())
    }
}

おわり

1行だけでできるの便利ですね

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