代码之家  ›  专栏  ›  技术社区  ›  Yossi

React native-显示具有曲线边界的视图

  •  0
  • Yossi  · 技术社区  · 7 年前

    你知道我如何创建两个充满屏幕的视图,它们之间有一个弯曲的边界吗?
    在下面的例子中,上面的一个(红色)应该有一个凹边框,另一个(蓝色)应该有一个凸边框?

    enter image description here

    使用答案中建议的代码(60%而不是60%,这不起作用),可以得到以下结果:

    enter image description here

    不是我想要的,不幸的是。。。

    0 回复  |  直到 7 年前
        1
  •  0
  •   Ron Astle Lobo    7 年前

    测试此代码并签出。

    <View>
        <View style={{width: "100%", height: 100, backgroundColor: 'skyblue'}} />
        <View style={{position:"absolute",top:50,width: "100%", height: 100, backgroundColor: 'steelblue',borderRadius:"60%"}} />
        <View style={{width: "100%", height: 100, backgroundColor: 'steelblue',}} />
    </View>
    

    推荐文章