@@ -20,9 +20,11 @@ var Dimensions = require('Dimensions');
20
20
*
21
21
* ### Displaying a line that's as thin as the device permits
22
22
*
23
- * A width of 1 is actually pretty thick on an iPhone 4+, we can do one that's
24
- * thinner using a width of `1 / PixelRatio.get()`. It's a technique that works
25
- * on all the devices independent of their pixel density.
23
+ * A width of 1 is actually pretty thick on devices with high pixel density
24
+ * (such as iPhone 4+ and many Android devices), we can make one that's
25
+ * thinner using a width of `1 / PixelRatio.get()`.
26
+ * It's a technique that works on all the devices independent of their
27
+ * pixel density.
26
28
*
27
29
* ```
28
30
* style={{ borderWidth: 1 / PixelRatio.get() }}
@@ -46,12 +48,18 @@ class PixelRatio {
46
48
/**
47
49
* Returns the device pixel density. Some examples:
48
50
*
51
+ * - PixelRatio.get() === 1
52
+ * - mdpi Android devices (160 dpi)
53
+ * - PixelRatio.get() === 1.5
54
+ * - hdpi Android devices (240 dpi)
49
55
* - PixelRatio.get() === 2
50
56
* - iPhone 4, 4S
51
57
* - iPhone 5, 5c, 5s
52
58
* - iPhone 6
59
+ * - xhdpi Android devices (320 dpi)
53
60
* - PixelRatio.get() === 3
54
61
* - iPhone 6 plus
62
+ * - xxhdpi Android devices (480 dpi)
55
63
* - PixelRatio.get() === 3.5
56
64
* - Nexus 6
57
65
*/
@@ -68,6 +76,7 @@ class PixelRatio {
68
76
*
69
77
* Currently this is only implemented on Android and reflects the user preference set in
70
78
* Settings > Display > Font size, on iOS it will always return the default pixel ratio.
79
+ * @platform android
71
80
*/
72
81
static getFontScale ( ) : number {
73
82
return Dimensions . get ( 'window' ) . fontScale || PixelRatio . get ( ) ;
0 commit comments