Skip to content
New issue

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

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

Already on GitHub? # to your account

resizeMode to fit width of screen WITHOUT cropping the picture #15

Open
alainib opened this issue May 9, 2019 · 0 comments
Open

resizeMode to fit width of screen WITHOUT cropping the picture #15

alainib opened this issue May 9, 2019 · 0 comments

Comments

@alainib
Copy link

alainib commented May 9, 2019

Hello,
Is there a way to display image, fitting it to the width of the screen but WITHOUT cropping the picture ?

  • 'cover' center & fit the picture well but it crop it
  • 'center' + scale={2} work only when image already in CACHE ( see above )
  • 'contain' + scale={2} work only when image already in CACHE

For example if the picture is {width : 500, height : 1000} and the parent View is of the size {width : 400, height : 500}. i want to fit it to width but can zoom in or out and see all the original image.

BUG of SCALE :

the code above render strangly :

<PhotoView
	source={'http://...........'}  // not a local ressource
	scale={2}
	resizeMode="center"
	minimumZoomScale={1}
	maximumZoomScale={10}
	style={{flex: 1,width: null,height: null}} 
            // same for style={{ flex: 1 }}
/> 

Screenshot_2019-05-09-09-03-28

(left image) the first time i open the view the scale param is ignored, the picture is in the middle not zoomed at all.
(right image) The second time i open the same view with same image ( so it's in the cache ), the scale param work well

Any tips ?
Thanks

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

No branches or pull requests

1 participant