【发布时间】:2020-07-02 11:51:30
【问题描述】:
我是 React Native 的新手。我正在设计要设计半圆形或椭圆形的 UI。我试过了,但输出不符合预期。我们可以在 react native 中使用 canvas 或 svg 吗?
实际:
当前:
代码.js
<View style={{ flex: 1, flexDirection: 'row' }}>
<View style={styles.circleSkyBlue}></View>
<View style={styles.circleViolet}></View>
</View>
code.css
circleViolet:{
width: 239,
height: 134,
borderBottomRightRadius: 50,
borderBottomLeftRadius: 100,
backgroundColor: '#596AB2',
transform: [
{scaleX: 1.2}
]
},
circleSkyBlue:{
width: 180,
height: 84,
borderBottomRightRadius: 100,
borderBottomLeftRadius: 50,
backgroundColor: '#69C0EC',
transform: [
{scaleX: 1}
] ,
overflow: 'hidden',
},
感谢任何帮助。 提前谢谢你
【问题讨论】:
-
您可以创建圈子并将其设为
position:absolute。然后将其设置为position。
标签: javascript css react-native