question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dynamic height on layout provider

See original GitHub issue

how i can achieve dynamic height on layout provider, i dont know which height each item rendered, so im trying to set layout provider like that

const layoutProvider = new LayoutProvider(
  () => 0,
  (type, dim) => {
    dim.width = window.width;
  }
);

i only know the width of rendered item, if i not set dim.height the item not rendering, and i already wrap recyclerview with flex view

<View style={{ flex: 1 }}>
        <RecyclerListView
          dataProvider={order}
          layoutProvider={layoutProvider}
          forceNonDeterministicRendering={true}
          rowRenderer={this.renderItem}
        />
</View>

and item

<View style={{ flex: 1, paddingHorizontal: 16 }}>
      <View style={styles.orderItemHeader}>
        <View style={styles.orderItemHeaderUser}>
          <AntDesign name="user" size={14} color="rgba(0,0,0, .7)"/>
          <Text style={styles.orderItemHeaderUserText}>Ardy Febriansyah</Text>
        </View>
        <Text font={Font.MEDIUM} style={styles.orderItemHeaderStatus}>Menunggu dikirim</Text>
      </View>
</View>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10

github_iconTop GitHub Comments

14reactions
ardyfebcommented, Nov 18, 2019

Hi, If the heights of the items are not known before in hand, an estimated height must be provided in the layout provider. The item will then resize according its dynamic height. An estimated height has to be provided along with the width in the layout provider.

i solved my problem with set dim.height = 1

1reaction
a845954commented, Oct 21, 2021

Can i set forceNonDeterministicRendering={true} only to height and have fixed width?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Telerik Web Forms Responsive Layout and Dynamic Height
Responsive Layout and Dynamic Height · Explicitly provide the new height in pixels via the set_height() client-side method. · Call the repaint() method...
Read more >
Responsive height layout with dynamic height elements
I want the main container to always be as tall as possible for the window and the left sidebar and results table to...
Read more >
Dynamic Minimum and Maximum Width/Height
This demo demonstrates how to use the `onResize` handler to accomplish this. In this grid, all elements are allowed a max width of...
Read more >
How to dynamically change the height of the section or group
How to dynamically change the height of the section or group when i use UICollectionViewCompositionalLayout. For example, i want to change the first ......
Read more >
JavaScript Data Grid: Master / Detail - Detail Height - AG Grid
Fixed Height: a custom fixed height can be provided for all detail sections instead of the default 300px . · Auto Height: detail...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found