小编Pon*_*ony的帖子

在 android 上响应本机滚动视图。滚动时子项与边框半径重叠

在android上,当我将边框半径应用于滚动视图时,内部容器会忽略外边框半径,我无法弄清楚如何使其符合。这是在 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>
Run Code Online (Sandbox Code Playgroud)

scrollview react-native

6
推荐指数
2
解决办法
926
查看次数

标签 统计

react-native ×1

scrollview ×1