JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 79
  • Score
    100M100P100Q85086F
  • License ISC

Image component, that resizes itself appropriately on all different iOS screens.

Package Exports

  • react-native-responsive-image

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-native-responsive-image) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

React Native Responsive Image

React Native component, that resizes itself appropriately on all different iOS screens.

##Why?

React Native size is rendered the same for iPhone4/5, iPhone6 and iPhone6 Plus. Desired behaviour in the real world is to have component, that scales relatively.

##Usage

npm install

All you need to do is download the component's code, require the component and then set it's initWidth and initHeight props.

These values are used as they are on iPhone6 Plus, and they are scaled down for iPhone4/5/6.

##Example

var React = require('react-native');
var ResponsiveImage = require('./ResponsiveImage');
var {
  AppRegistry,
  StyleSheet,
  View,
} = React;

var ResponsiveImage = React.createClass({
  render: function() {
    return (
      <View style={{flex: 1, justifyContent: 'center',}}>
        <ResponsiveImage source={{uri: 'http:' + item.profile_picture.href}} initWidth="80" initHeight="80" item={item} />
      </View>
    );
  }
});


AppRegistry.registerComponent('AwesomeProject', () => ResponsiveImage);

##Todo

  • iPad version