问题
I have a button that's styled as a TouchableOpacity.
On iOS this button has a white background and round corners, but in Android the background color doesn't get applied when there's a border-radius, it does when I take it out. border-radius also doesn't appear to have any effect regardless of whether there's a background color or not in Android.
I know I can use some conditional based on the platform, but I'd like to know if it's possible to have the same between the two platforms with the same code.
export const SomeButton = styled.TouchableOpacity`
flex: 1;
border-radius: 4
background: white;
`
回答1:
I had exactly the same problem. I had to roll back the react-native to 0.60.5
来源:https://stackoverflow.com/questions/58421150/touchableopacity-border-radius-breaks-background-color-on-android-react-native