Android上的React原生滚动视图。当滚动时,孩子们的边界半径会重叠。

问题描述 投票:0回答:1

在安卓系统上,当我将边界半径应用于滚动视图时,内部容器会忽略外部边界半径,我不知道如何使其符合。这是在Pixel 2模拟器上,红色虚线显示了底层边界半径和重叠的位置。这段代码只是我做的一个标准的滚动视图,以仔细检查它是否发生在最简单的滚动视图实现上,它确实发生了。

enter image description here

  <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>
react-native scrollview
1个回答
0
投票

尝试在滚动视图样式中使用溢出: "隐藏"。

© www.soinside.com 2019 - 2024. All rights reserved.