Android ScrollView ignores its border (screenshots attached)

Trying to set a border on a ScrollView . It works fine on iOS, but not on Android:

  scrollView: { borderColor: '#000000', borderStyle: 'solid', borderWidth: (1), } 

Nice black frame on iOS:

enter image description here

There is no black border on Android:

enter image description here

Try it here: https://rnplay.org/apps/cJbAjg

+6
source share
1 answer

I can’t explain why, but one of the fixes is the following:

 var styles = StyleSheet.create({ container: { marginTop: 20, marginHorizontal: 1, borderRadius: 8, borderColor: 'black', borderStyle: 'solid', borderWidth: 1, }, scrollView: { height: 40, }, item: { backgroundColor: '#ddd', borderRadius: (5), padding: 5, margin: 5, } }); 

I tested this on an Android device using rn 0.26.0

+3
source

All Articles