Watchos 9 displays widget kit gauges smaller

129 Views Asked by At

We implemented new widget kit complications to our app. They are running perfectly with watchos 10 devices, but when we test it with watchos 9.x devices (both simulator and real devices), what we see is a little bit weird, i.e. complications does not fit in their reserved areas since they are smaller

and also in not all but some watch faces complications area is fully colored out with a background even though there are no background views or background images

We searched both stackoverflow and internet but none seems to meet such a behaviour.

I attach here two screenshots of two gauges: one of them is circularcapacity and the other is circular, both are smaller in size than they are supposed to be, and one of them is colored out in some watch faces...

screenshot1 screenshot2

both of the screenshots are belonging to same widgets both complications do not have any images, just text with emojis

We need your precious help for two issues: 1- for smaller size issue 2- for having fully colored background even though they do not have any backgrounds

Any guidance will be appreciated so much, Thanks in advance

scaleeffect, scaledToFit, scaledToFill approaches did not change total size of the complication or being colored out issues, the result was the same

we can also supply any additional information, codes etc if it is necesssary

1

There are 1 best solutions below

0
Bektaş Kart On

We figured out the issue. since with new watchos widgetkit containerbackground API requirement, we were using a copy-paste code block which was grabbed over internet

StaticConfiguration(kind: kind, provider: Provider()) { entry in
        if #available(watchOS 10.0, *) {
            watchwidgetextensionEntryView(entry: entry)
                .containerBackground(.fill.tertiary, for: .widget)
        } else {
            watchwidgetextensionEntryView(entry: entry)
                .padding()
                .background()
        }
    }

code inside else block, which for watchos < 10.0 was obviously the reason. We were so focused in another swift file which is creating views, but missed the main point in extensions' file.

replacing else block with

else {
            watchwidgetextensionEntryView(entry: entry)
                .background(.clear)
        }

fixed the issue