在安卓系统上,当我将边界半径应用于滚动视图时,内部容器会忽略外部边界半径,我不知道如何使其符合。这是在Pixel 2模拟器上,红色虚线显示了底层边界半径和重叠的位置。这段代码只是我做的一个标准的滚动视图,以仔细检查它是否发生在最简单的滚动视图实现上,它确实发生了。
<ScrollView
contentContainerStyle={{
alignItems: 'center',
justifyContent: 'space-between',
}}
style={{
padding: 20,
backgroundColor: 'green',
borderTopLeftRadius: 45,
borderTopRightRadius: 45,
}}>
<View
style={{
width: '100%',
height: 400,
borderRadius: 20,
backgroundColor: 'red',
}}
/>
<View
style={{
width: '100%',
height: 400,
borderRadius: 20,
backgroundColor: 'red',
}}
/>
<View
style={{
width: '100%',
height: 400,
borderRadius: 20,
backgroundColor: 'red',
}}
/>
<View
style={{
width: '100%',
height: 400,
borderRadius: 20,
backgroundColor: 'red',
}}
/>
</ScrollView>
尝试在滚动视图样式中使用溢出: "隐藏"。