On Android 4.4, ListView separator lines are inconsistent in thickness, and some do not render. I can't see how this can be a code issue, this is how I render them:
separator: {
height: 1,
backgroundColor: 'grey',
}
...
<ListView
renderSeparator={(sectionID, rowID) =>
<View key={`${sectionID}-${rowID}`} style={styles.separator} />
}
.../>
Here is a screenshot of a View with this problem:
This issue does not happen on iOS or Android 6.
Anyone had this problem before?
Update
I did a test, this is not Android4 issue. It happens on all API version when running on Nexus One device (in android emulator)
Actually there is no fix. It's RN "render-canvas-bug". But I found hack solution.
Style.listView: { backgroundColor: '#fff', }, // or another backgroundColor you need
Then:
Only important TouchableOpacity style is Style.separatorRow to render your separator. This style should be inside listView_item, where you can use another styles.
You can use StyleSheet.hairlineWidth instead of 1 but it's not a must.
I had the same issue and solved changing the view height from a number to StyleSheet.hairlineWidth as some folks said before. Trying to be more visual/specific:
Before:
After:
Just give the height:
hairlineWidth
in styleI had this issue on iOS and worked around it by adding a hairline margin, like so:
I reported it on GitHub
My workaround was to style the containing view and text like this:
This is the ListView:
Looks nice:
This happens because you have empty rows in your data source. You can style your separators to see it
To avoid this just filter your data.