gpt4 book ai didi

react-native - 我们可以在React Native中仅设置View的一个侧面阴影吗?

转载 作者:行者123 更新时间:2023-12-05 00:48:01 26 4
gpt4 key购买 nike

就像标题所说的那样,我们如何在React Native中仅设置View的一个侧面阴影,或隐藏任何侧面阴影?
我要显示的是唯一的一个侧面阴影,任何解决方案?

最佳答案

用这个

const style = {
shadowColor: "#000000",
shadowOffset: { width: 0, height: 2 }, // change this for more shadow
shadowOpacity: 0.4,
shadowRadius: 6,
}

例如:
  • shadowOffset: { width: 0, height: 10 }阴影仅放置在View
  • 的底部
  • shadowOffset: { width: 0, height: -10 }阴影仅放置在View
  • 的顶部
  • shadowOffset: { width: 10, height: 0 }阴影仅放置在View
  • 的右侧
  • shadowOffset: { width: -10, height: 10 }阴影仅位于View
  • 的左侧

    关于react-native - 我们可以在React Native中仅设置View的一个侧面阴影吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50505771/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com