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

Getting error recyclerlistview needs to have a bounded size .currently height or width is 0 #74

Closed
sam201401 opened this issue Nov 15, 2017 · 6 comments

Comments

@sam201401
Copy link

I am trying to add fixed footer how can I solve this problem

@naqvitalha
Copy link
Collaborator

Try giving flex:1 to the listview. Make sure the parent view is also deterministic in height/width.

@SudoPlz
Copy link

SudoPlz commented Jan 4, 2018

@naqvitalha do we have to necessarily set a parent width and the height to the immediate parent View that contains the RecyclerListView?

Even though we do know the width of the content of the RecyclerListView we have no idea what the content height will be. (We're using RecyclerListView as a horizontal list) so setting a fixed height on the parent View hides the content.

Any ideas?

@naqvitalha
Copy link
Collaborator

@SudoPlz All you need is some inferable way to have determine dimensions to compute layouts. An example can help me understand better. If you can build whatever you're trying to with plain ScrollView then most likely it'll be possible with RecyclerListView. RecyclerListView can monitor ScrollView size changes if you set canChangeSize prop to true.

@SudoPlz
Copy link

SudoPlz commented Jan 4, 2018

Basically the problem is that if people use huge Accessibility font sizes, then the height of the content should change, and I have no way of knowing that upfront.

What I tried though was, I used minHeight instead of height and the error is gone now.
Not sure if that's ideal what do you think @naqvitalha ?

@naqvitalha
Copy link
Collaborator

It does sound like the solution for now. It will cause one set of layouts to get discarded but unless you have tens of thousands of items that shouldn't be noticeable. I'll get back if I can think of something better.

@lvstross
Copy link

lvstross commented Mar 4, 2019

My fix for this issue was to wrap my list in a View component and give that view a height and width.

      return <View style={{ width: '100%', height: this.props.dimensions.get('height') }}>
        <RecyclerListView
          keyboardShouldPersistTaps={true}
          dataProvider={data}
          layoutProvider={this.layoutProvider}
          rowRenderer={this.renderRow}
          canChangeSize={true}
        />
      </View>;

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

4 participants