小编Fur*_*nG.的帖子

React-Native:具有底部半径的遮罩图像

如何在图像中制作边框底部半径?

以及如何将图像屏蔽到绿色区域?

图片在这里

我已经尝试了以下代码,但我无法在上面共享的图像中获得半径比

查看代码:

<View style={styles.wrapper}>
    <View style={styles.welcomeWrapper}>
        <View style={styles.welcomeImageWrapper}>
            <Image style={{width:'100%'}} source={require('../assets/images/test-slide.jpg')}/>
        </View>
    </View>
    <View style={{
        height: 100,
        backgroundColor: colors.white,
        justifyContent: 'flex-end',
        alignItems: 'center'
    }}>
       <Text style={{marginBottom:50,fontSize:18,fontFamily:'Montserrat-Regular'}}>Deneme Text </Text>
    </View>
</View>
Run Code Online (Sandbox Code Playgroud)

样式代码:

wrapper:{
    flex:1,
    display: 'flex',
    backgroundColor:colors.white,
},
welcomeWrapper:{
    flex:1,
    justifyContent:'center',   
    backgroundColor:colors.green01,
    overflow: 'hidden',
    position:'relative',
    width:'100%',
    borderBottomRightRadius:Dimensions.get('window').width/100*50,
    borderBottomLeftRadius:Dimensions.get('window').width/100*50,
},
Run Code Online (Sandbox Code Playgroud)

border react-native react-native-stylesheet

6
推荐指数
1
解决办法
2612
查看次数