Aaditya Paliwal
Aaditya Paliwal

Reputation: 607

Background Color and Border Radius property not working together in React Native - Android

It happened after updating my react native project to 0.61.1 from 0.59.9. I have TouchableOpacity with borderRadius and backgroundColor style When I look into the iOS it looks good but in Android, there is no background color in the view. It is just transparent. Previously, there was no such issue.

<TouchableOpacity style={{backgroundColor: 'black' ,justifyContent: 'center', flex:1, borderRadius: scale(22)}} />         

enter image description here

Upvotes: 1

Views: 1538

Answers (1)

Erick Kondela
Erick Kondela

Reputation: 149

Is scale() a custom function returning a value? I have tried it this way though and it works;

<TouchableOpacity style={{backgroundColor: 'black' ,justifyContent: 'center', flex:1, borderRadius: 22}}>
  <Text>Sign In</Text>
</TouchableOpacity> 

Or else try to clear caches: npm clear cache --force

Upvotes: 0

Related Questions