mirror of
https://github.com/ivanvorobei/SwiftUI.git
synced 2026-04-21 00:01:29 +02:00
Add Jike
This commit is contained in:
27
Examples/Jike/SwiftUI_Jike/Cell/CircleImage.swift
Executable file
27
Examples/Jike/SwiftUI_Jike/Cell/CircleImage.swift
Executable file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
See LICENSE folder for this sample’s licensing information.
|
||||
|
||||
Abstract:
|
||||
A view that clips an image to a circle and adds a stroke and shadow.
|
||||
*/
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct CircleImage: View {
|
||||
var imgName:String
|
||||
var body: some View {
|
||||
Image(imgName)
|
||||
.clipShape(Circle())
|
||||
.overlay(
|
||||
|
||||
Circle().stroke(Color.white, lineWidth: 1))
|
||||
|
||||
.shadow(radius: 3)
|
||||
}
|
||||
}
|
||||
|
||||
struct CircleImage_Preview: PreviewProvider {
|
||||
static var previews: some View {
|
||||
CircleImage(imgName:"meIcon")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user