0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Missing argument for parameter #1 in call。flutterとswiftでのhomewidget作成

Posted at

flutterとswiftでのhomewidget作成

@available(iOS 14.0, *)
struct WidgetEntryView: View {
    var entry: Provider.Entry

    var body: some View {
        if #available(iOS 17.0, *) {
            Text(entry.summaryContent)
                .padding()
                .containerBackground(for: .widget) 
        } else {
            Text(entry.summaryContent)
                .padding()
        }
    }
}

これを以下のように修正

@available(iOS 14.0, *)
struct WidgetEntryView: View {
    var entry: Provider.Entry

    var body: some View {
        if #available(iOS 17.0, *) {
            Text(entry.summaryContent)
                .padding()
                .containerBackground(.regularMaterial, for: .widget) // 修正箇所
        } else {
            Text(entry.summaryContent)
                .padding()
        }
    }
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?