我有一个react-native Modal
,我想用这样的圆角渲染它:
但是如果我这样定义它:
<Modal
style={{
borderTopLeftRadius: 10,
borderTopRightRadius: 10,
overflow: 'hidden',
}}
什么也没有发生(至少在Android上如此)。我还尝试用Modal
包裹View
,它们的样式相同但没有成功。
我在做什么错了?
答案 0 :(得分:0)
解决方案是使用以下样式将View
放在Modal
内(紧贴花后):
<View
style={{
borderTopLeftRadius: 10,
borderTopRightRadius: 10,
overflow: 'hidden',
}}
>