mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-08 22:42:40 +08:00
PixelRatio.pixel()
Summary: This implements #5073. It adds a static method `PixelRatio.pixel()` which returns the smallest drawable line width, primarily for use in styles. It also updates the example apps to use the new function. Closes https://github.com/facebook/react-native/pull/5076 Reviewed By: svcscm Differential Revision: D2799849 Pulled By: nicklockwood fb-gh-sync-id: b83a77790601fe882affbf65531114e7c5cf4bdf
This commit is contained in:
committed by
facebook-github-bot-5
parent
78c6e416ae
commit
cd89016ee7
@@ -20,7 +20,6 @@ var ViewExample = require('./ViewExample');
|
||||
var createExamplePage = require('./createExamplePage');
|
||||
var {
|
||||
AlertIOS,
|
||||
PixelRatio,
|
||||
ScrollView,
|
||||
StyleSheet,
|
||||
Text,
|
||||
@@ -227,7 +226,7 @@ var styles = StyleSheet.create({
|
||||
},
|
||||
line: {
|
||||
backgroundColor: '#bbbbbb',
|
||||
height: 1 / PixelRatio.get(),
|
||||
height: StyleSheet.hairlineWidth,
|
||||
},
|
||||
row: {
|
||||
backgroundColor: 'white',
|
||||
@@ -236,7 +235,7 @@ var styles = StyleSheet.create({
|
||||
paddingVertical: 15,
|
||||
},
|
||||
separator: {
|
||||
height: 1 / PixelRatio.get(),
|
||||
height: StyleSheet.hairlineWidth,
|
||||
backgroundColor: '#bbbbbb',
|
||||
marginLeft: 15,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user