2.0.0 • Published 7 years ago
react-native-shape-image-view v2.0.0
react-native-shape-image-view
Getting started
$ npm install react-native-shape-image-view --save
Mostly automatic installation
$ react-native link react-native-shape-image-view
Manual installation
iOS
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-shape-image-view
and addRNShapeImageView.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNShapeImageView.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)<
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.reactlibrary.RNShapeImageViewPackage;
to the imports at the top of the file - Add
new RNShapeImageViewPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-shape-image-view' project(':react-native-shape-image-view').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-shape-image-view/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-shape-image-view')
Windows
- In Visual Studio add the
RNShapeImageView.sln
innode_modules/react-native-shape-image-view/windows/RNShapeImageView.sln
folder to their solution, reference from their app. - Open up your
MainPage.cs
app
- Add
using Cl.Json.RNShapeImageView;
to the usings at the top of the file - Add
new RNShapeImageViewPackage()
to theList<IReactPackage>
returned by thePackages
method
Usage
HexagonImage (Android only)
import React, { PropTypes } from 'react';
import { HexagonImage } from 'react-native-shape-image-view';
export const Example = () => (
<HexagonImage
borderWidth={5}
borderColor={'red'}
backgroundColor={'blue'}
src={require('./something.png')} // or { uri: 'https://.....' }
setDefaultSize={true} // set image default width and height, it's works only with local assets
style={{
// some styles here
}}
onLoad={() => console.log('hexagon image loaded')}
/>
);
HexagonView (Android 4.2+, iOS 8.4+)
import React, { PropTypes } from 'react';
import { HexagonView } from 'react-native-shape-image-view';
export const Example = () => (
<HexagonView
isHorizontal={true /* true | false */}
style={{
height: 100,
width: 100,
borderColor: 'red',
borderWidth: 5
/* some styles here */
}}
>
<Image
source={require('./test.jpg')}
style={{ width: 200, height: 200 }}
/>
</HexagonView>
);
2.0.0
7 years ago
1.3.0
7 years ago
1.2.5
7 years ago
1.2.4
7 years ago
1.2.3
7 years ago
1.2.2
7 years ago
1.2.1
7 years ago
1.2.0
7 years ago
1.1.3
7 years ago
1.1.2
8 years ago
1.1.1
8 years ago
1.1.0
8 years ago
1.0.3
8 years ago
1.0.2
8 years ago
1.0.1
8 years ago
0.9.5
8 years ago
0.9.4
8 years ago
0.9.3
8 years ago
0.9.2
8 years ago
0.9.1
8 years ago
0.9.0
8 years ago
0.0.4
8 years ago
0.0.3
8 years ago
0.0.2
8 years ago
0.0.1
8 years ago
1.0.0
8 years ago