I would like to understand how we can know whether the apple watch is 38mm or 42mm so that I can programmatically set the images for UI elements.
1 Answer
I figured it out in WKInterfaceDevice
class
NSLog(@"%@", CGRectCreateDictionaryRepresentation([WKInterfaceDevice currentDevice].screenBounds));
42mm { Height = 195; Width = 156; X = 0; Y = 0; }
38mm { Height = 170; Width = 136; X = 0; Y = 0; }
-
5In Swift, you use WKInterfaceDevice.currentDevice().screenBounds for the same effect.– OdinodinFeb 13, 2015 at 21:08
-
Does this size includes the status bar? For an image (for example) that fill the screen, we must subtract the height of the status bar?– MarkusOct 2, 2016 at 0:01
-
@Markus: That is the number of pixels on the physical screen, so it includes status bars and everything else. Oct 31, 2018 at 15:49