react-native - 如何在 react-native - iOS、Android 中为 View 创建插入阴影?

标签 react-native shadow

有没有办法在 react native 中为 View 创建插入阴影?

最佳答案

试试这个:

const styles = StyleSheet.create({
containerStyle: {
  borderWidth: 1,
  borderRadius: 2,
  borderColor: '#ddd',
  borderBottomWidth: 0,
  shadowColor: '#000',
  shadowOffset: { width: 0, height: 2 },
  shadowOpacity: 0.8,
  shadowRadius: 2,
  elevation: 1,
  marginLeft: 5,
  marginRight: 5,
  marginTop: 10,
}
})

关于react-native - 如何在 react-native - iOS、Android 中为 View 创建插入阴影?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46871254/

相关文章:

javascript - FlatList 不渲染图像

javascript - 如何提高 three.js 中的阴影质量

css - 平行于 x 轴旋转按钮阴影

javascript - 在 Hooks React 中使用静态变量

ios - Ios 是否允许用户从应用程序内浏览器中的应用程序注册到网页

react-native - react native : how to apply shadow and borderRadius to a View?

c++ - 找不到合适的阴影贴图深度偏差?

iphone - 在 iOS 上做阴影的最快方法是什么?

ios - 如何在React Native(iOS)中打开URL文件类而不是Bundle文件类

javascript - 从 React Native 的列表中获取唯一的项目?