子视图覆盖父视图的边界.[反应天然]

Vik*_*ash 4 javascript reactjs react-native react-native-android react-native-ios

我正在尝试按照本地反应做.我在父视图中设置borderRadius.但孩子最重要的是.所以在最终视图中,borderRadius不可见

export default class FlexDimensionsBasics extends Component {
  render() {
    return (
      // Try removing the `flex: 1` on the parent View.
      // The parent will not have dimensions, so the children can't expand.
      // What if you add `height: 300` instead of `flex: 1`?
      <View style={{flex: 1, borderRadius:30, backgroundColor:'red'}}>
        <View style={{flexGrow: 10, backgroundColor: 'powderblue'}} />
        <View style={{flexGrow: 20, backgroundColor: 'skyblue'}} />
        <View style={{flexGrow: 30, backgroundColor: 'steelblue'}} />
      </View>
    );
  }
}
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

有什么我想要添加的吗?

Ant*_*amp 9

添加overflow: "hidden"到您的父样式