Skip to content

adds support for a similar functionality as <Image capInsets={...} /> to android

Notifications You must be signed in to change notification settings

igorczapski/react-native-image-capinsets

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-image-capinsets

adds support for a similar functionality as <Image capInsets={...} /> to android. behind the scenes it will generate a NinePatchDrawable and set as background for the android ImageView

Installation

  1. npm i --save react-native-image-capinsets
  2. react-native link react-native-image-capinsets

Examples

Android resource:

import ImageCapInset from 'react-native-image-capinsets';

<ImageCapInset
	source={require('./bubble.png')}
	capInsets={{ top: 8, right: 8, bottom: 8, left: 8 }}
	/>

Local file:

<ImageCapInset source={{uri: "/data/user/0/com.example/files/content/test.png"}}
			   resizeMode="stretch"
			   capInsets={{top: 8, right: 8, bottom: 8, left: 8}}
			   />

Remote file:

<ImageCapInset source={{uri: "https://examplesite.com/test.png"}}
			   resizeMode="stretch"
			   capInsets={{top: 8, right: 8, bottom: 8, left: 8}}
			   />

About

adds support for a similar functionality as <Image capInsets={...} /> to android

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 91.0%
  • JavaScript 9.0%