react-native-imagebutton
Getting started
$ npm install react-native-image-button-text --save
Usage
;
props
- width: PropTypes.number.isRequired, //the component size
- height: PropTypes.number.isRequired,
- text: PropTypes.string.isRequired, //show text on the componet
- backgroundColor: PropTypes.string, //button color default transparent
- activeOpacity: PropTypes.number, //default 0.3
- fontSize: PropTypes.number,
- textColor: PropTypes.string,
- onPress: PropTypes.func,
- onPressIn: PropTypes.func,
- onPressOut: PropTypes.func,
- paddingTop: PropTypes.number, //text marging top
- paddingLeft: PropTypes.number, //text marging left
- paddingRight: PropTypes.number, //text marging right
- paddingBottom: PropTypes.number,//text marging bottom
- textAlignVertical: PropTypes.oneOf(['flex-start', 'center', 'flex-end']),//text vertical position,default center
- textAlignHorizontal: PropTypes.oneOf(['flex-start', 'center', 'flex-end']) //text horizontal position,default center
like this!
<ImageButton width=80 height=40 text="click me" backgroundColor="red"/><ImageButton style=marginTop: 20 width=945 height=305 text="click me" source=/>
use the ImageButton Component
{ }; <ImageButton style=stylesbtn width=250 height=64 fontSize=20 textColor="#ffe490" paddingTop=4 textAlignHorizontal="flex-start" onPress=this_share source= text="share" />