Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nothing gets render. #1

Closed
susylPearl opened this issue Jun 24, 2016 · 6 comments
Closed

Nothing gets render. #1

susylPearl opened this issue Jun 24, 2016 · 6 comments

Comments

@susylPearl
Copy link

susylPearl commented Jun 24, 2016

when i implemented photo view library as:

<Image style={{flex:1}}> <PhotoView source={{ uri: "http://c1.staticflickr.com/8/7412/27488731000_96ad0b9740_k.jpg" }} minimumZoomScale={0.5} maximumZoomScale={3} androidScaleType="center" onLoad={() => console.log("Image loaded!")}/> </Image>

Nothing gets render what had happened, or my syntax are wrong.

@alwx
Copy link
Owner

alwx commented Jun 24, 2016

@susylPearl Why do you wrap PhotoView in Image? PhotoView is image itself.

@susylPearl
Copy link
Author

susylPearl commented Jun 24, 2016

ok i got what you said, but when i implemented it correctly, and when i run it by react-native run-android. it gives error in java file as cannot find symbol in new PhotoviewPackage().

import me.alwx.reactnative.PhotoViewPackage; doesnot exist

@alwx
Copy link
Owner

alwx commented Jun 24, 2016

@susylPearl I am sorry, it was an error in Readme.md file. You should use another package name:
import com.reactnative.photoview.PhotoViewPackage;

Thanks for reporting and, please, close the issue if everything is fine now.

@alwx
Copy link
Owner

alwx commented Jun 24, 2016

By the way, it is much easier to use rnpm link :)

@susylPearl
Copy link
Author

when i have done everything right also but got render nothing. what is problem? my code is below:

`'use strict';

import React, {Component} from 'react';
import {
StyleSheet,
Text,
View,
ToolbarAndroid,
Dimensions,
Navigator,
ViewPagerAndroid
} from 'react-native';

import JResource from './javra-resource';
import JavraTheme from './app/css/javra-theme-css';

import Image from 'react-native-transformable-image';
//import ViewPager from 'react-native-viewpager';
import ViewPager from "react-native-pager";
import PhotoView from 'react-native-photo-view';
var {height, width} = Dimensions.get('window');

var IMGS = [
'https://images.unsplash.com/photo-1441742917377-57f78ee0e582?h=1024',
'https://images.unsplash.com/photo-1441716844725-09cedc13a4e7?h=1024',
'https://images.unsplash.com/photo-1441448770220-76743f9e6af6?h=1024',
'https://images.unsplash.com/photo-1441260038675-7329ab4cc264?h=1024',
'https://images.unsplash.com/photo-1441126270775-739547c8680c?h=1024',
'https://images.unsplash.com/photo-1440964829947-ca3277bd37f8?h=1024',
'https://images.unsplash.com/photo-1440847899694-90043f91c7f9?h=1024'
];

export default class JavraBasket extends Component {
static contextTypes = {
openDrawer: React.PropTypes.func.isRequired,
};

constructor(){
super();

}

render(){

  return(
    <Navigator
      initialRoute= {{id: 'Home' , component: 'Home' , index:0}}
      renderScene = {this.renderScene.bind(this)}
      statusBarBackgroundColor={'royalblue'}
      configureScene={this._configureScene}
      />


  );
}

renderScene(route, navigator){

var pages = [];
for (var i = 0; i < IMGS.length; i++) {
  pages.push(

<View style={{flex:1, backgroundColor:'black', marginTop:20}}>
<PhotoView
source={{
uri: 'https://images.unsplash.com/photo-1441742917377-57f78ee0e582?h=1024'
}}
minimumZoomScale={0.5}
maximumZoomScale={3}
androidScaleType="center"
onLoad={() => console.log("Image loaded!")}>

</View>

  );
}
  var toolbarActions = [{title:'Next',show:'always'}];

  return(
          <PhotoView
                  source={{
                    uri: "http://c1.staticflickr.com/8/7412/27488731000_96ad0b9740_k.jpg"
                  }}
                minimumZoomScale={0.5}
                maximumZoomScale={3}
                androidScaleType="center"
                onLoad={() => console.log("Image loaded!")}>
           </PhotoView>




  );
}

}
`

@alwx
Copy link
Owner

alwx commented Jun 27, 2016

@susylPearl Difficult to say from this extract of code.
Please, upload it to gist.github.com and attach the link here to improve the readability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants