5 Answers, 1 is accepted
Please have in mind that the RadListView has internal scrollview and its content can be easily scrolled, hence wrapping it in additional one is not recommended. You might want to reconsider the design of the application. Wouldn't it be better if navigation is used to visualize those different controls in a separate page instead of ScrollView?
If your case demand nesting scroll views, then you can try using the HorizontalOptions and VerticalOptions properties of the RadListView.
For example, if you set the VerticalOptions to Start and wrap the RadListView in a Grid layout, its height should be automatically calculated to be as high as the content or as high as it can get in the viewport.
It is difficult to suggest any specific implementation because I do not know the exact requirements but the suggested one is a good starting point.
Please give it a try, experiment with the suggested properties and let us know if you need any further assistance.
Regards,
Pavel R. Pavlov
Telerik by Progress
Hi Pavel,
Thank you for the response. However, this does not solve my particular need. Let me explain a little more.
On both Android and iOS, it is perfectly acceptable to have a RadListView within a ScrollView. If you set the height of the RadListView to the exact height of the content, even older versions of Android (like API 19) handle it beautifully. The whole page scrolls exactly like you would expect, and you can have more than just the RadListView on the page.
If I knew the exact height of each row, I could simply set the height of the RadListView equal to the number or rows times the row height. However, I have rows that are different heights due to the content in each row.
So, I am looking for a way to set the RadListView's height to the exact height of all the rows, knowing that each row will have a different height. Simply wrapping it in a Grid, even with setting the VerticalOptions as you suggested, does not accomplish that.
Any other input would be greatly appreciated.
Thanks,
Ron
Thank you for clarifying your particular scenario. You can force the listview to realize all its contents based on the parent view by accessing Android specific property through custom renderer. That way the listview will be forced to realize and measure all its cells thus giving accurate result for its total size.
I have prepared sample project demonstrating how achieve the desired behavior through custom renderer.
Let us know if this helps.
Regards,
Tsvyatko
Telerik by Progress
Hi and thank you for your response! My app is for both Android and iOS. How could I accomplish this for iOS?
Thanks,
Ron
The iOS listview does stretch automatically when nested inside scrollviewer. You can check the previously attached project and run it under iOS.
If you encounter any related issues do not hesitate to contact us.
Regards,
Tsvyatko
Telerik by Progress