2
2

More than 3 years have passed since last update.

Apple Watch コンテンツサイズ測定結果

Last updated at Posted at 2021-09-06

Screen Shot 2021-09-15 at 12.23.28.png

※ シミュレータで計測しています

WKInterfaceDevice

screenBounds

デバイスの画面範囲。コンテンツの内容に関わらず、デバイスごとに固定の数値。
WKInterfaceDevice.current().screenBounds

x y width height
38mm 0 0 136 170
42mm 0 0 156 195
40mm 0 0 162 197
44mm 0 0 184 224
41mm 0 0 176 215
45mm 0 0 198 242

SwiftUI GeometryReader

SwiftUIでサイズを取得するためのGeometryReader。
GeometryReader { geometry in }

size

コンテンツを表示できる範囲。
40mm, 44mm, 45mmは画面の丸みがあるため、SafeArea Bottom部分も除かれている。

width height
38mm 136 151
42mm 156 174
40mm 161 141
44mm 183 162
41mm 174 147
45mm 196 172

safeAreaInsets

top left bottom right
38mm 19 0 0 0
42mm 21 0 0 0
40mm 28 0.5 28 0.5
44mm 31 0.5 31 0.5
41mm 34 1 34 1
45mm 35 1 35 1

TabView内の画面 (PageNavigation有り)

38mm, 42mm, 41mmは、+7ptのSafeArea Bottomになる。 45mmは +8pt、 40mm, 44mmは変わらない。

size

width height
38mm 136 144
42mm 156 167
40mm 161 141
44mm 183 162
41mm 174 140
45mm 196 164

safeAreaInsets

top left bottom right
38mm 19 0 7 0
42mm 21 0 7 0
40mm 28 0.5 28 0.5
44mm 31 0.5 31 0.5
41mm 34 1 41 1
45mm 35 1 43 1

WKInterfaceController

SwiftUIを使わない場合、WKInterfaceControllerのメソッドからサイズを取得できる。
contentFrameは、SafeArea Left,Bottom,Rightも含んだ値になっているっぽい。

contentFrame

x y width height
38mm 0 19 136 151
42mm 0 21 156 174
40mm 0 28 162 169
44mm 0 31 184 193
41mm 0 34 176 181
45mm 0 35 198 207

contentSafeAreaInsets

top left bottom right
38mm 19 0 0 0
42mm 21 0 0 0
40mm 28 0.5 28 0.5
44mm 31 0.5 31 0.5
41mm 34 1 34 1
45mm 35 1 35 1
2
2
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
2
2