1

For some reason my scroll view is not working in my emulator. The Feedcards are being rendered but they are not scrolling. When I surround the FeedCards with <List> they go from vertical center to at the top of the screen, so it is doing something. Just not allowing for scrolling.

import React, { Component } from 'react';
import styled from 'styled-components/native';

import FeedCard from '../components/FeedCards/FeedCard';

const Root = styled.View`
  flex: 1;
  justifyContent: center;
  backgroundColor: #f2f2f2;
  paddingTop: 5;
`;

const List = styled.ScrollView`
  flex: 1;
`;

class HomeScreen extends Component {
  state = { }
  render() {
    return (
    <Root>
        <List>
          <FeedCard />
          <FeedCard />
        </List>
    </Root>
    );
  }
}

export default HomeScreen;

1 Answer 1

2

What's up?

ScrollView only works if the number of rendered elements pass into the device width/height. If you is using an Ios emulator, the scroll should be unlocked, but in Android emulator, just with pass the size

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.