Android borderLeftWidth and borderLeftColor broken
I am attempting to use a css trick to produce triangles using the code:
'use strict';
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
Text,
View,
} = React;
var SampleApp = React.createClass({
render: function() {
return (
<View style={styles.container}>
<View style={styles.triangle}/>
</View>
);
}
});
var styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
triangle: {
width: 0,
height: 0,
backgroundColor: 'transparent',
borderStyle: 'solid',
overflow: 'hidden',
borderTopWidth: 50,
borderRightWidth: 0,
borderBottomWidth: 50,
borderLeftWidth: 100,
borderTopColor: 'transparent',
borderRightColor: 'transparent',
borderBottomColor: 'transparent',
borderLeftColor: 'red',
},
});
AppRegistry.registerComponent('SampleApp', () => SampleApp);
In iOS this produces:

But in Android, it only shows a black square:

Does Android support using these styles?
It doesn't seem to like borderLeftWidth, borderLeftColor, etc.
I don't see anything related in the documented Known Issues.
Edit: The screenshots are from RNPlay running react-native 0.13.0-rc.
Hey Jpoliachik, thanks for reporting this issue!
React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.
- If you don't know how to do something or something is not working as you expect but not sure it's a bug, please ask on StackOverflow with the tag
react-nativeor for more real time interactions, ask on Discord in the #react-native channel. - If this is a feature request or a bug that you would like to be fixed, please report it on Product Pains. It has a ranking feature that lets us focus on the most important issues the community is experiencing.
- We welcome clear issues and PRs that are ready for in-depth discussion. Please provide screenshots where appropriate and always mention the version of React Native you're using. Thank you for your contributions!
Just had a look at the code and these are not currently supported on Android. Have filed a task internally (t9789502) to look further at supporting it at some point.
Anyone up for doing a PR for this?
anyone doing this already?
hey!!! anyone doing this already?
Not that I know of. Feel free to jump on it :)
@mobileDevNativeCross , @dmmiller , I did some digging last weekend, it seems we can do it here at Line 348.
The reasoning is that if we are drawing rectangles, we never gonna have any triangle any where.
However, if we are to use canvas.drawPath, instead of canvas.drawRect, we will be changing the default behavior of all the borders with different colors. I wonder if that is what we want.
Would love to have your options.
btw, I haven't started yet. So feel free to jump on it.
Please take a look at PR #5911 @mobileDevNativeCross @dmmiller
Thanks,
Huang
I think this issue can be closed by #5911 , right?
Appears to fixed via https://github.com/facebook/react-native/commit/a6a4389bf4a581de5adfe0e5dda4aa4f70438dfc
Feel free to re-open if problem persists.