Got an answer to my bug report:
Apple Watch Series 7 has more rounded corners that your interface will need to account for. You can apply additional padding to the label in WatchKit, or use the .scenePadding modifier in SwiftUI.
For more information please see the “Meet Apple Watch Series 7” Tech Talk on developer.apple.com: https://developer.apple.com/videos/play/tech-talks/10884
I could not find the WatchKit equivalent of SwiftUI .scenePadding modifier.
So, I solved problem by testing if Watch7 (testing values of WKInterfaceDevice.current().screenBounds).
private func isWatchSeries7() -> Bool {
let watch = WKInterfaceDevice.current()
let scale = watch.screenScale
let size = watch.screenBounds.size
let watch7_41 = scale >= 2.0 && size == CGSize(width: 176, height: 215)
let watch7_45 = scale >= 2.0 && size == CGSize(width: 198, height: 242)
return watch7_41 || watch7_45
}
Of course I'll have to adapt for Series 8.
If Watch 7, I adjust insets (group is the WKInterfaceGroup):
if isWatchSeries7() { // 4.11.2021
group.setContentInset(UIEdgeInsets(top: 0, left: 2, bottom: 0, right: 0))
}
.
There were other solutions to find watch model, but did not work on simulator for testing. And would require similar adaptation when Watch 8 comes out.
https://stackoverflow.com/questions/49087330/how-to-determine-the-apple-watch-model
-
—
IamYourClounon
Add a CommentBonjour cher @Claude31 J’ai un problème de Spam que je n’arrive pas à résoudre et j’ai constaté que sur la question vous avez beaucoup répondu à des threads. Please @Claude31help me. Mon application est sur Android et j’ai juste développé la version iOS mais Apple rejette pour motif Spam. C’est vraiment désolant de ne pas savoir concrètement ce qu’on doit changer? Faut-il avoir deux versions opposées pour une même application selon qu’on soit sur Android ou sur Apple ? Je suis prêt à discuter @Claude31 . Voici mon mail billybroni@gmail.