2017-12-02 1 views
0

React 네이티브 뷰가 iPhone Plus 버전에서 왜곡 된 픽셀을 표시하고 동일한 뷰가 iPhone 5,6 또는 7 버전에서 매우 우아하게 표시됩니다. 아이폰의 더하기 버전에서 언젠가는 언젠가 더 심한 이미지를 보게 될 것입니다. 다음과 같이 enter image description here 코드 대신 플렉스도 도움이되지 않습니다의 열을 divId는 할 화면 너비를 사용React 네이티브 뷰가 iPhone Plus에서 왜곡 된 픽셀을 표시합니다.

<View style={[styles.headerRow, { paddingHorizontal: 5 }]} > 
    <View style={{ flex: 3, borderColor: theme.color.gray.light, borderRightWidth: .5, alignSelf: 'center' }}> 
     <Text style={[skin.text.smaller, skin.text.bold, { textAlign: 'center', padding: 8 }]}>{'TITLE'}</Text> 
    </View> 
    <View style={{ flex: 2, alignItems: 'center', borderColor: theme.color.gray.light, borderRightWidth: .5, alignSelf: 'center' }}> 
     <Text style={[skin.text.smaller, skin.text.bold, { textAlign: 'center', padding: 8 }]}>{'BUCKIT'}</Text> 
    </View> 
    <View style={{ flex: 2.8, alignItems: 'center' }}> 
     <Text style={[skin.text.smaller, skin.text.bold, { textAlign: 'center', padding: 8 }]}>{'YOUR AVERAGE'}</Text> 
    </View> 
</View> 

입니다.

답변

0

해결책 : 나는, 아이폰 OS가 borderWidth 설정 한 후 덜 선호하지 않으며, 따라서 당신은 0.3로 설정 기본값이 hairlineWidth라는 StylesSheet 변수를 제공하는 1 이상의 값을 사용하거나 반응 네이티브 수 있습니다 해결책을 발견

. 구성 요소의 생성자에서 StyleSheet.hairlineWidth = 0.5로 설정하여 값을 변경할 수 있습니다.

<View style={{borderWidth: StyleSheet.hairlineWidth}}> ... </View> 
관련 문제