iOS 15-WidgetKit-iPadOS增加尺寸类型

2021-06-08  本文已影响0人  CocoaJason
/// An extra large widget.
    ///
    /// > Note: This property is only available in iPadOS.
    @available(iOS 15.0, *)
    @available(macOS, unavailable)
    case systemExtraLarge
struct Extension_TwoEntryView : View {
    var entry: Extension_Two_Provider.Entry

    @Environment(\.widgetFamily) var family
    var body: some View {
        switch family {
        case .systemSmall:
            Extension_Two_SmallView()
        case .systemMedium:
            Extension_Two_MediumView()
        case .systemExtraLarge:
            Extension_Two_ExtraLargeView()
        default:
            Extension_Two_LargeView()
        }
    }
}
上一篇下一篇

猜你喜欢

热点阅读