ScrollView zooming an Android

So I was sad to discover the ScrollView’s minimum and maximum zoom Scale are iOS only. Is there any solution for Android? Are people just ok with not letting Android people zoom?

this is just how it works on android. what are you trying to build? you may be able to use GestureHandler to accomplish it: https://docs.expo.io/versions/v27.0.0/sdk/gesture-handler

When you say “this is just how it works on Android”… are you suggesting there is no intention to make it behave like iOS? or that’s just how it behaves now? Is the feature being worked on? I have a gallery section in my app that I want to allow users to zoom in/out of photos… I don’t want to sound unappreciative but I just figure something like this seems pretty basic.

I’m also not sure how I would use the gesture-handler to create this functionality because also the zoomScale property of ScrollView is iOS only as well. Is the theory to somehow resizes the inner contents of the ScrollView based upon a gesture? Seems extremely cumbersome, as I planned on having possibly hundreds of children inside the ScrollView.

i’m saying this is how scrollviews work on android. react-native exposes the underlying components and their capabilities. we are not working on changing the native scrollview on android, no.

you wouldn’t use scrollview for this at all. you can implement this with react-native-gesture-handler but there isn’t a prebuilt component that handles it for you entirely right now, at least not in a way that looks and feels great without adding a native module that does this for you (which would require detaching). i agree this should be easier to do, our next release includes a new animations api (don’t worry, you don’t need to learn it) that integrates into gesture-handler and the main test-case while building the api was to create an ios-style photo viewer. you can see it in action here: Declarative future of gestures and animations in React Native - Krzysztof Magiera (@kzzzf) - YouTube

@notbrent Thanks for explaining this, makes a lot more sense now. Sorry if I sounded rude, not my intention I just want to understand better. Looking forward to seeing what comes in the next release.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.