ReactNative写三角形

reactNative

业务中气泡常用三角写法:


   <View style={styles.arrow}>
   </View>

   arrow: {
       width: getRpx(30),
       height: getRpx(30),
       borderWidth: getRpx(15),
       borderTopColor: 'transparent',
       borderRightColor: 'transparent',
       borderBottomColor: 'transparent',
       borderLeftColor: '#262626',
       justifyContent: 'center',
       alignItems: 'center',
   }

导航常用三角写法:


    <View style={styles.arrow}>
       <View style={styles.inArrow}></View>
    </View>

    arrow: {
        width: getRpx(30),
        height: getRpx(30),
        borderWidth: getRpx(15),
        borderTopColor: 'transparent',
        borderRightColor: 'transparent',
        borderBottomColor: 'transparent',
        borderLeftColor: '#262626',
        justifyContent: 'center',
        alignItems: 'center',
    }
    inArrow: {
        width: getRpx(22),
        height: getRpx(22),
        borderWidth: getRpx(11),
        borderTopColor: 'transparent',
        borderRightColor: 'transparent',
        borderBottomColor: 'transparent',
        borderLeftColor: '#fff',
        position: 'absolute',
        left: getRpx(-12),
        top: getRpx(-9)
    }

posted @ 2020-08-05 16:35  Marphy  阅读(1026)  评论(0编辑  收藏  举报