首页 > 解决方案 > 边框半径按钮反应原生元素的问题

问题描述

你能帮我解决这个反应原生元素库上按钮的边框半径问题吗?

我正在为按钮添加边框半径,但它的不透明度仍然是矩形,我不明白为什么。

https://github.com/react-native-elements/react-native-elements/issues/2324

标签: react-nativeuser-interfacereact-native-elements

解决方案


在 ReactNative: 0.65, Elements: 3.4.2 和 API 29 这仍然发生在我身上,但我发现一个解决方案设置 overflow:'hidden' on View 像这样:

<View style={{
  width:"100%", 
  borderRadius: 30, 
  overflow: 'hidden' 
}}>
  <Button
    title="Login"
    type="solid"
    buttonStyle={{borderRadius: 30}}
  />
</View>

推荐阅读