Closed bakerac4 closed 4 years ago
+1 I am also seeing this behavior occurring on my own project.
@tsonevn Can you confirm this is a bug on your end? I have a client who is putting substantial pressure on us to fix this and showing him that you can A) Reproduce and B) there are no workarounds would be a huge help.
I am closing this one as it is a duplicate of the same scenario already logged here https://github.com/NativeScript/nativescript-ui-feedback/issues/846
As mentioned in the other thread, currently the RadListView does not support dynamically changing the height of the itemTemplate
once it has been rendered. Dynamic item size (height) is only supported for itemTemplate
that is measurable initially (it can have different size but not have its size changed after it has been rendered). We are doing our best to handle this case but we limited to the way iOS and its UICollectionView
handles runtime changes to the size of its UICells
.
As a workaround you can set a fix height of the items by setting the itemHeight of the listViewLayout:
<lv:RadListView.listViewLayout>
<lv:ListViewLinearLayout itemHeight="210" />
</lv:RadListView.listViewLayout>
@VladimirAmiorkov Do you mind me asking a question? I have this implementation for Glimmer Native https://github.com/bakerac4/glimmer-native/blob/master/src/dom/native/RadListViewElement.ts#L31 - So loadView will always be called but at that point we don't have an item. Then itemLoading is called, and at that point we attach an item to the view, and the view re-renders. But at that point is it too late? has the view already been rendered by iOS with no item in it behind the scenes? Or does it not get rendered until itemLoading is called
So I spent roughly 3-4 days trying to figure this out thinking it was an issue with Glimmer Native ( http://glimmernative.com/#/ ). I finally decided to check and see if any other flavors of nativescript were showing this behavior which is when I checked out a radlistview showcase and modified it.
I created this example showcasing the issue. Im on iOS 13 (not sure if that matters) https://play.nativescript.org/?template=play-tsc&id=HYGzbZ&v=5
Essentially what you want to do is keep scrolling until you load data and you will see weird rendering issues with items being added
It seems this issue has cropped up before and has been resolved. I really need different height items with different height images to work for my app. Are there are known workarounds? I can switch to the original ListView for which the issue does not occur for, but I need some of the functionality that radlistview provides related to scrollToIndex and loadOnDemandBufferSize