ImageView
@MainActor
public struct ImageView : UIViewRepresentable
图片视图,支持网络图片和动图
-
指定本地占位图片初始化
Declaration
Swift
@MainActor public init(_ placeholder: UIImage? = nil)
-
指定网络图片URL初始化
Declaration
Swift
@MainActor public init(url: URLParameter?)
-
设置网络图片URL
Declaration
Swift
@MainActor public func url(_ url: URLParameter?) -> ImageView
-
设置网络图片加载选项
Declaration
Swift
@MainActor public func options(_ options: WebImageOptions) -> ImageView
-
设置本地占位图片
Declaration
Swift
@MainActor public func placeholder(_ placeholder: UIImage?) -> ImageView
-
设置图片显示内容模式,默认scaleAspectFill
Declaration
Swift
@MainActor public func contentMode(_ contentMode: UIView.ContentMode) -> ImageView
-
Declaration
Swift
public typealias UIViewType = ResizableView<UIImageView>
-
Declaration
Swift
@MainActor public func makeUIView(context: Context) -> ResizableView<UIImageView>
-
Declaration
Swift
@MainActor public func updateUIView(_ uiView: ResizableView<UIImageView>, context: Context)
-
Declaration
Swift
@MainActor public static func dismantleUIView(_ uiView: ResizableView<UIImageView>, coordinator: ())