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

ScrollView cannot scroll its content #14164

Closed
Chandhru08 opened this issue May 24, 2017 · 4 comments
Closed

ScrollView cannot scroll its content #14164

Chandhru08 opened this issue May 24, 2017 · 4 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@Chandhru08
Copy link

Chandhru08 commented May 24, 2017

Description

When i included components into ScrollView, it doesnt scrolls the content.

Reproduction Steps and Sample Code

videotogif_2017 05 25_02 42 24 1

Step1: Try to scroll the contents up and down
Step2: When srolling the child components, it works

Code:

<View>
      <View style={descriptionContainerStyle}>
        <View>
            <Text style={{ paddingLeft: 5 }}>Brand</Text>
            <Text style={{ paddingLeft: 5 }}>Name</Text>
            <Picker
            style={{ width: 200 }}
            selectedValue={dummy}
            onValueChange={value => dummy({ value })}
            mode="dropdown"
            >
            <Picker.Item label="1kg" value="1kg" />
            <Picker.Item label="2kg" value="2kg" />
            <Picker.Item label="3kg" value="3kg" />
          </Picker>
        </View>
        <View style={innerContainerStyle}>
          <View style={priceTextStyle}>
            <Text>Rs 13 off</Text>
            <Text>Rs 100</Text>
          </View>
          <View>
            <Text> Rs 87 </Text>
          </View>
          <View>
            <Button> Add </Button>
          </View>
        </View>
      </View>
          <ScrollView>
                    <GaleryCarousel
                    data={imagesDemo}
                    joinFirst={'http://i.imgur.com'}
                    defaultImageIndex={0}
                    onLongPress={(key, element) => { console.log(key, element); }}
                    />
                    <TabBarNav />
                    <Text> Hi</Text>
                    <Text> Hi</Text>
                    <Text> Hi</Text>
                    </ScrollView>
    </View>

Note: I deleted some Hi text components.

Solution

Kindly let me know the solution.

Additional Information

  • React Native version: 0.44.0
  • Platform: Android
  • Development Operating System: Windows
  • Dev tools: I build with cmd line code 'react-native run-android'
@breeny
Copy link

breeny commented May 30, 2017

@Chandhru08 can you please provide the style contained within descriptionContainerStyle

I suspect this is because there isn't any bound heights from what I can see here. From the ScrollView documentation:

Keep in mind that ScrollViews must have a bounded height in order to work, since they contain unbounded-height children into a bounded container (via a scroll interaction). In order to bound the height of a ScrollView, either set the height of the view directly (discouraged) or make sure all parent views have bounded height.

@Chandhru08
Copy link
Author

@breeny thanks for looking into the issue.

Here is the style parameters passed into the container view,
descriptionContainerStyle: { borderColor: '#333333', elevation: 2, opacity: 2 }

Can you tell me how to pass the bounded parameter to ScrollView component or a link also would be better.

@indu127pal
Copy link

+1

@hramos hramos added the Icebox label Aug 24, 2017
@hramos
Copy link
Contributor

hramos commented Aug 24, 2017

Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!

If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:

  • Does the issue still reproduce on the latest release candidate? Post a comment with the version you tested.
  • If so, is there any information missing from the bug report? Post a comment with all the information required by the issue template.
  • Is there a pull request that addresses this issue? Post a comment with the PR number so we can follow up.

If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.

@hramos hramos closed this as completed Aug 24, 2017
@facebook facebook locked as resolved and limited conversation to collaborators Aug 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Aug 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

6 participants