2.0.0 • Published 9 years ago

react-native-shape-image-view v2.0.0

Weekly downloads
14
License
MIT
Repository
github
Last release
9 years ago

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

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-shape-image-view and add RNShapeImageView.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNShapeImageView.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

Android

  1. 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 the getPackages() method
  1. 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')
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-shape-image-view')

Windows

Read it! :D

  1. In Visual Studio add the RNShapeImageView.sln in node_modules/react-native-shape-image-view/windows/RNShapeImageView.sln folder to their solution, reference from their app.
  2. Open up your MainPage.cs app
  • Add using Cl.Json.RNShapeImageView; to the usings at the top of the file
  • Add new RNShapeImageViewPackage() to the List<IReactPackage> returned by the Packages 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

9 years ago

1.3.0

9 years ago

1.2.5

9 years ago

1.2.4

9 years ago

1.2.3

9 years ago

1.2.2

9 years ago

1.2.1

9 years ago

1.2.0

9 years ago

1.1.3

9 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

0.9.5

10 years ago

0.9.4

10 years ago

0.9.3

10 years ago

0.9.2

10 years ago

0.9.1

10 years ago

0.9.0

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago

1.0.0

10 years ago