Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mauriciopazpp/9f973f9c81eeca38ff5274ecfcdf01de to your computer and use it in GitHub Desktop.
Save mauriciopazpp/9f973f9c81eeca38ff5274ecfcdf01de to your computer and use it in GitHub Desktop.
Insert image using the width size of phone
_renderImage(image) {
let contentHeight = scaleModerate(375, 1)
let height = Dimensions.get('window').height - contentHeight
let width = Dimensions.get('window').width
image = (<Image style={[style.image, {height, width}]}
source={ backgroundImg }/>)
return image
}
render() {
let image = this._renderImage()
return (
<RkAvoidKeyboard
onStartShouldSetResponder={ (e) => true }
onResponderRelease={ (e) => Keyboard.dismiss() }
style={ style.screen }>
{ image }
//...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment