设备Size测试

设备的bounds, scale,真机测试结果如下:

设备 bounds nativeBounds scale nativeScale
iPhone6 normal {{ 0, 0}, {375, 667}} {{0, 0}, {750, 1334}} 2.00000 2.0000
iPhone6 zoom {{0, 0}, {320, 568}} {{0, 0}, {750, 1331.25}} 2.00000 2.343750
iPhone6 Plus normal {{0, 0}, {414, 736}} {{0, 0}, {1080, 1920}} 3.00000 2.608696
iPhone6 Plus zoom {{0, 0}, {375, 667}} {{0, 0}, {1080, 1920}} 3.00000 2.880000

bounds in point, nativeBounds in pixel;
scale for screen, native for physical screen.

模拟器 iPhone6
2015-11-25 16:47:44.930 SizeClassDemo[29750:425396] bounds= {{0, 0}, {375, 667}} 2015-11-25 16:47:44.930 SizeClassDemo[29750:425396] scale=2.000000 2015-11-25 16:47:44.931 SizeClassDemo[29750:425396] nativeBounds=, {750, 1334}}
2015-11-25 16:47:44.931 SizeClassDemo[29750:425396] nativeScale=2.000000

真机 iPhone6 normal
2015-11-25 16:17:39.587 SizeClassDemo[270:20538] bounds= {{0, 0}, {375, 667}} 2015-11-25 16:17:39.588 SizeClassDemo[270:20538] scale=2.000000 2015-11-25 16:17:39.588 SizeClassDemo[270:20538] nativeBounds=, {750, 1334}}
2015-11-25 16:17:39.588 SizeClassDemo[270:20538] nativeScale=2.000000

真机 iPhone6 zoom
2015-11-25 16:16:33.455 SizeClassDemo[22862:4690224] bounds= {{0, 0}, {320, 568}} 2015-11-25 16:16:33.456 SizeClassDemo[22862:4690224] scale=2.000000 2015-11-25 16:16:33.456 SizeClassDemo[22862:4690224] nativeBounds=, {750, 1331.25}}
2015-11-25 16:16:33.456 SizeClassDemo[22862:4690224] nativeScale=2.343750

模拟器 iPhone6 Plus
2015-11-25 16:19:00.893 SizeClassDemo[29508:414511] bounds= {{0, 0}, {414, 736}} 2015-11-25 16:19:00.894 SizeClassDemo[29508:414511] scale=3.000000 2015-11-25 16:19:00.895 SizeClassDemo[29508:414511] nativeBounds=, {1242, 2208}}
2015-11-25 16:19:00.895 SizeClassDemo[29508:414511] nativeScale=3.000000

真机 iPhone6 Plus normal
2015-11-25 16:30:38.465 SizeClassDemo[1046:416308] bounds= {{0, 0}, {414, 736}} 2015-11-25 16:30:38.467 SizeClassDemo[1046:416308] scale=3.000000 2015-11-25 16:30:38.467 SizeClassDemo[1046:416308] nativeBounds=, {1080, 1920}}
2015-11-25 16:30:38.467 SizeClassDemo[1046:416308] nativeScale=2.608696

真机 iPhone6 Plus zoom
2015-11-25 16:31:43.935 SizeClassDemo[1067:417588] bounds= {{0, 0}, {375, 667}} 2015-11-25 16:31:43.936 SizeClassDemo[1067:417588] scale=3.000000 2015-11-25 16:31:43.936 SizeClassDemo[1067:417588] nativeBounds=, {1080, 1920}}
2015-11-25 16:31:43.936 SizeClassDemo[1067:417588] nativeScale=2.880000

Comments