`borderStyle` has no effect on Android, border is always solid
See original GitHub issueSetting borderStyle
has no effect on Android. Regardless of the setting, the border will always be solid.
Environment
Environment:
OS: macOS Sierra 10.12.6
Node: 7.10.1
Yarn: 1.2.1
npm: 4.2.0
Watchman: 4.5.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.0 AI-171.4443003
Packages: (wanted => installed)
react: 16.2.0 => 16.2.0
react-native: 0.54.0 => 0.54.0
Expected Behavior
When setting the borderStyle
to “dashed” or “dotted”, I expect the view to have a dashed or dotted border. This works correctly on iOS:

Actual Behavior
Regardless of setting, the border is solid on Android:

Steps to Reproduce
Create a View
with styles specifying a borderWidth
, borderColor
, and borderStyle
(borderRadius
was also set, since there seem to be existing issues with the border when borderRadius
is not specified).
This component will reproduce the issue:
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
export default class App extends React.Component {
render() {
return (
<View style={styles.container}>
<Text>Open up App.js to start working on your app!</Text>
<Text>Changes you make will automatically reload.</Text>
<Text>Shake your phone to open the developer menu.</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
marginVertical: 200,
marginHorizontal: 20,
borderColor: '#000',
borderRadius: 5,
borderWidth: 5,
borderStyle: 'dashed'
},
});
An Expo Snack is also available that reproduces the issue: https://snack.expo.io/r1NCAukKf
Issue Analytics
- State:
- Created 6 years ago
- Reactions:9
- Comments:16 (6 by maintainers)
Top Results From Across the Web
Why does a CSS border look different on Android?
How some devices render '1px' with multiple pixels and it is not always pretty because they are using different pixel ratios (dpr) such...
Read more >Borders (Cascading Style Sheets: The Definitive Guide)
Despite this, the reason you don't usually see borders is that the default style is none, which prevents them from existing. If a...
Read more >border-style - CSS: Cascading Style Sheets - MDN Web Docs
Displays a border with an extruded appearance. It is the opposite of groove . inset. Displays a border that makes the element appear...
Read more >Learn To Create Border Style in React Native - eduCBA
Here we discuss how we can create Border Style in React Native with Syntax and ... you can combine border styles to create...
Read more >CSS Border - Javatpoint
Note: The border-color property is not used alone. It is always used with other border properties like "border-style" property to set the border...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m facing this issue on RN 0.55.2 too
It’s a known issue - no need to add more “me too” comments for now.