SwiftUI

SwiftUI-Image

2019-11-19  本文已影响0人  白色天空729

原文:https://iosdevcenters.blogspot.com/2019/09/swiftui-circular-image-example.html

import SwiftUI

struct ContentView: View {

@State var scale: CGFloat = 1.0
    var body: some View {
        Image("swiftui")
        .resizable()
        .frame(width: 200, height: 200)
        .clipShape(Circle())
        .overlay(Circle().stroke(Color.white, lineWidth: 4))
        .shadow(radius: 10)
      }
    }

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

图片资源:


image.png

效果如图:


屏幕快照 2019-11-19 下午3.49.46.png
上一篇下一篇

猜你喜欢

热点阅读