ShirlyChenLaLaLa / ShirlyChenLaLaLa.github.io

学习前端的一些记录
Other
1 stars 0 forks source link

How to use border radius only for 1 corner (react-native)? #7

Open ShirlyChenLaLaLa opened 6 years ago

ShirlyChenLaLaLa commented 6 years ago

假设仅对Image标签的左上角和左下角设置半径。

      <View style={styles.imgBox}>
        <Image source={{ uri: 'your image url' }} style={styles.img} />
      </View>
     const styles = EStyleSheet.create({
        imgBox: {
               width: px(72),
               height: px(72),
               borderBottomLeftRadius: 2,
               borderTopLeftRadius: 2,
               overflow: 'hidden',
        },
         img: {
               width: px(72),
               height: px(72),
         },
    })

适用于ios