gpt4 book ai didi

react-native - 如何在 React Native 中给 WebView 中的圆角半径

转载 作者:行者123 更新时间:2023-12-02 02:52:50 24 4
gpt4 key购买 nike

我添加了一个 View 作为 Webview 的容器,然后添加了 corderRadius 但没有成功

<View
flex={1}
borderTopLeftRadius={12}
borderTopRightRadius={12}
>
<WebView
style={{ flex: 1 }}
/>
</View>

最佳答案

我找到了解决方案,只需在父 View 中添加 overflow: "hidden"

  <View
style={{
overflow: "hidden",
flex: 1,
borderTopLeftRadius: 12,
borderTopRightRadius: 12,
}}
>
<WebView style={{ flex: 1 }} />
</View>

关于react-native - 如何在 React Native 中给 WebView 中的圆角半径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61673447/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com