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

doesn't work for nested scrollviews #34

Open
sagark1510 opened this issue Jan 21, 2019 · 6 comments
Open

doesn't work for nested scrollviews #34

sagark1510 opened this issue Jan 21, 2019 · 6 comments

Comments

@sagark1510
Copy link

import React, {Component} from 'react';
import {Text, View, ScrollView, Dimensions} from 'react-native';
import NestedScrollView from 'react-native-nested-scroll-view';

export default class Test extends Component {
  render() {
    return (
      <View style={{flex: 1}}>
        <NestedScrollView horizontal>
          <View style={{width: Dimensions.get('window').width}}>
            <NestedScrollView>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <NestedScrollView horizontal style={{paddingVertical: 50}}>
                <Text> textInComponent </Text>
                <Text> textInComponent </Text>
                <Text> textInComponent </Text>
                <Text> textInComponent </Text>
                <Text> textInComponent </Text>
                <Text> textInComponent </Text>
                <Text> textInComponent </Text>
                <Text> textInComponent </Text>
                <Text> textInComponent </Text>
                <Text> textInComponent </Text>
                <Text> textInComponent </Text>
                <Text> textInComponent </Text>
                <Text> textInComponent </Text>
                <Text> textInComponent </Text>
                <Text> textInComponent </Text>
                <Text> textInComponent </Text>
                <Text> textInComponent </Text>
                <Text> textInComponent </Text>
                <Text> textInComponent </Text>
                <Text> textInComponent </Text>
                <Text> textInComponent </Text>
                <Text> textInComponent </Text>
                <Text> textInComponent </Text>
                <Text> textInComponent </Text>
                <Text> textInComponent </Text>
                <Text> textInComponent </Text>
                <Text> textInComponent </Text>
                <Text> textInComponent </Text>
              </NestedScrollView>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
              <Text> textInComponent </Text>
            </NestedScrollView>
          </View>
        </NestedScrollView>
      </View>
    );
  }
}

horizontal scrollview than vertical scrollview than again horizontal scrollview. first horizontal scrollview will be paginated and can have more than one vertical scrollview which I can swipe left or right... can this library solve this issue? above example is not working as expected

@cesardeazevedo
Copy link
Owner

Hi, do you have any gif showing what you are trying to do? i am not sure if i understood correctly.

@sagark1510
Copy link
Author

on ios it works perfect like below...

nestedscrollios

but on android it doesn't for example...

nestedscrollandroid

@cesardeazevedo
Copy link
Owner

I got it, but as you probably know, this library doesn't work on iOS, and uses the main ScrollView on ios, so i am not really sure if my library suits your needs.

Have you tried to combine regular ScrollView and NestedScrollView together in different ways?
I will give a try in a couple days.

@sagark1510
Copy link
Author

@cesardeazevedo I think you miss understood my question. iOS behavior is fine. I want the same behavior in android.

Horizontal scroll -> vertical scroll -> horizontal scroll. it's working on ios but not on android.

@cesardeazevedo
Copy link
Owner

I completely understood your question, i am just not sure if you understood the purposed of this library, i am saying that nested scrolls on iOS is a completely different mechanism from android, and my library is not trying to make what iOS does, so you can't expect that something working on iOS will work on android by using this library.

I can't guarantee any compatibility with iOS with a library designed for android only.

@sagark1510
Copy link
Author

@cesardeazevedo okay. so what do you suggest to achieve the same behavior in android?

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