2017-02-01 6 views
1

Android vs iOS에서 테두리 색상과의 동작 차이를 설명하는 문서를 찾지 못하는 것 같습니다. 아래 코드는 iOS에는 좋지만 Android에는 적합하지 않습니다. 안드로이드는 파란색 테두리를 모두 무시하기로 결정합니다.React Native : Android : borderRadius와 다른 테두리 색상

borderRadius이 제거되면 문제가 해결됩니다. borderRadius가 제거되면

import React, { Component } from 'react'; 
    import { 
    AppRegistry, 
    StyleSheet, 
    Modal, 
    Text, 
    View 
    } from 'react-native'; 

    export default class test extends Component { 
    render() { 
     return (
     <View style={styles.container}> 
      <View style={[styles.innerContainer, {borderTopColor: 'blue'}]}></View> 
     </View> 
    ); 
    } 
    } 

    const styles = StyleSheet.create({ 
    container: { 
     flex: 1, 
     justifyContent: 'center', 
     padding: 20 
    }, 
    innerContainer: { 
     borderRadius: 4, 
     borderWidth: 1, 
     borderColor: '#111', 
     height: 200 
    }, 
    }); 

    AppRegistry.registerComponent('test',() => test); 
+0

해당 클래스는 어디에 적용됩니까? 코드를 보여주십시오. –

+0

게시물을 적절하게 업데이트했습니다. 고맙습니다! –

답변

1

문제는 사라집니다.

예, Android에서 there's a bug 예, 이렇게하면 한 번 경계가 설정되거나 사라집니다.

최상의 방법은 래퍼보기를 사용하거나 반경을 사용하지 않는 것입니다.