struct Text
显示一行或多行只读文本的视图。
在小组件中显示动态日期
即使你的小组件没有运行,在小组件中也会显示基于时间的最新信息。
小组件可以使用许多 (但不是全部) SwiftUI 视图来呈现内容。使用下面列出的视图来实现小组件的视图。
注释
小组件不能使用 UIView
或 NSView
包装的 UIKit 或 AppKit 视图。
struct Text
struct Image
struct Label
struct Link
struct HStack
struct VStack
struct ZStack
struct LazyHStack
struct LazyVStack
struct LazyHGrid
struct LazyVGrid
struct GridItem
struct ForEach
struct Group
struct GroupBox
struct Section
struct OutlineGroup
struct Spacer
struct Divider
struct EmptyView
struct EquatableView
struct Rectangle
struct RoundedRectangle
struct Circle
struct Ellipse
struct Capsule
struct Path
struct ScaledShape
struct RotatedShape
struct OffsetShape
struct TransformedShape
struct ContainerRelativeShape
struct Color
struct ImagePaint
struct Gradient
struct LinearGradient
struct AngularGradient
struct RadialGradient
struct ForegroundStyle
struct FillStyle
struct BackgroundStyle
struct SelectionShapeStyle
struct SeparatorShapeStyle
struct StrokeStyle
struct Canvas
struct GeometryProxy
struct GeometryReader
struct AnyView
struct TupleView