0

I have been using HasUnevenRows property of ListView quite successfully in Android while running my .NET MAUI app. Nevertheless, this property, whether set "True" or "False", does not work in iOS. All the rows have the same height anyway.

I am displaying a list of items in the page, where each of these items represent a question and the user can click a button(present in each row) to expand the row to display all the answers to that question. In Android, the row expands and contracts comfortably(in line with the number of answers). Not in iOS. I tried to use forceUpdateSize method of ViewCell but it ruins the performance of the app. I found this solution in Xamarin forms, but it is very brief and does not help me in any way. https://stackoverflow.com/questions/48183532/forceupdatesize-listview-issue-on-ios If I get a better understanding of what is proposed here, it would be fine.

1 Answers1

0

There are two similar issues on the github. One is about [MacOS, iOS] ListView and CollectionView on the fly changes don't change the size of the layout. And you can try the comment in this issue.

The other one is about ListView with resizing ViewCell has strange behaviour on iOS. This issue has been moved to the Backlog milestone. You can follow up it on the github.

In addition, I have checked the solution you found which is used the custom ListViewRenderer. You can also use the custom render in the maui.

Liyun Zhang - MSFT
  • 8,271
  • 1
  • 2
  • 14
  • Thanks for your answer. If you understood the method described in the link I posted, please enunciate more on it. I am already using custom renderer in my maui project, I have no problem with that. I have problem with how the solution is given, where the event is supposed to be, whether forceUpdateSize function is still to be used, and what is the "whateverContentView" used in the code. Please elaborate on it if possible. Many thanks. – Shaurya Shikhar Mar 03 '23 at 05:05
  • You can refer to [this comment which shows the detail about the solution](https://github.com/xamarin/Xamarin.Forms/issues/2735#issuecomment-520633123). @ShauryaShikhar – Liyun Zhang - MSFT Mar 03 '23 at 05:29
  • I'm not sure this can work in the maui or not. But this seems a continual probelm in the xamarin and maui. Hope this can help you. @ShauryaShikhar – Liyun Zhang - MSFT Mar 03 '23 at 05:35
  • You are welecome. Looking forward to your reply. @ShauryaShikhar – Liyun Zhang - MSFT Mar 03 '23 at 09:27
  • Thanks, there are still performance issues after using the solution. It is such a pity that iOS can't expand a listview item like android. This issue is so old, it should have been settled already. – Shaurya Shikhar Mar 04 '23 at 04:12
  • You can follow up the issue on the github. @ShauryaShikhar – Liyun Zhang - MSFT Mar 06 '23 at 10:07