#DEPRECATED
dashed border already works on react native 0.19+. Use style : { borderStyle: 'dashed' }
in your stylesheet.
Very simple native component that gives you dashed borders. Copied from brentvatne example here
- Run
npm install react-native-dashed-border --save
- Open your project in XCode, right click on
Libraries
and clickAdd Files to "Your Project Name"
(Screenshot) then (Screenshot). - Add
libRNDashedBorder.a
toBuild Phases -> Link Binary With Libraries
(Screenshot). - Whenever you want to use it within React code now you can:
var DashedBorder = require('react-native-dashed-border');
Just npm install react-native-dashed-border
and require should work.
- lineDashPattern is not supported on android.
var React = require('react-native');
var DashedBorder = require('react-native-dashed-border');
var DashedBorderExampleApp = React.createClass({
render: function() {
return (
<DashedBorder color={React.processColor('#343434')} lineDashPattern={[4,2]} lineWidth={1.5} style={styles.container}>
<Image source={require('image!announcement')} style={styles.image} />
</DashedBorder>
);
}
});