maui: Latest update to Visual Studio for Mac breaks CollectionView
Description
Yesterday (5/18/23) I had finished testing my CacheAll app on my Mac and was ready to upload it to the AppStore and run it from TestFlight. However, VS told me there was an update so I said OK to let it update. I then rebuilt the app and tried it out in the debugger. To my surprise the CollectionView on the main page starts out looking fine but as soon as I scroll it it gets messed up. Below are screenshots from both Mac and iOS.
I used Time Machine to go back to 5/17/23 to back out of the update and all is well again. The version I am using now is VS Mac 17.5.5 build 12. The strange thing is that when I ask it to check for updates it says that I am up-to-date. Yesterday I am positive there was an update that messed things up. Has that update been backed out?
Steps to Reproduce
Let VS Mac update to version available on 5/18/23. That seems to be gone now.
Link to public reproduction project repository
?
Version with bug
7.0.49
Last version that worked well
6.0
Affected platforms
iOS, macOS
Affected platform versions
iOS and MacCatalyst
Did you find any workaround?
Use Time Machine to revert to previous VS Mac before updates.
Relevant log output
none
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 4
- Comments: 17
You can try change maui version using the following XML tag:
<MauiVersion>6.0.301</MauiVersion>This will try change stuff using NuGet packages. You might need to Clean all compilation files and restart Visual Studio to apply that correctly. We have successfully workarounded a (regression) issue introduced in new .NET 7 service release on Android by setting the version to a different (older) .NET 7 service release (patch). Various Visual Studio versions install various .NET MAUI SDK (MAUI si updated via Visual Studio instalation), so you have to check what is the one which you need.
Not all people using timemachine 😃
Seems like they dropped out the testers between MAUI Preview 24 and 25. Or did they not have them since Preview 13?
@janseris Yeah, you’re right. Anyways, I’ll just use a PC at uni, I got enough of debugging MAUI instead of my actual assignment 😃
@janseris @kocevilija this workaround worked for me. Thank you for your assistance. I agree the problem should be fixed in the new MAUI version. It’s a big issue.
I have put
<MauiVersion>7.0.52</MauiVersion>in the.csprojfile inside firstPropertyGroup, right below theSupportedOSPlatformVersions tag and it works.However, this is a workaround and problem should be fixed in the new MAUI version.
Unfortunately it’s not only CollectionView. They heavily broken something related to expanding layouts on iOS/MacCatalyst. What changed comparing to latest updated is that both collectionview and scrollview now aggressively expand in a “container unaware” state of logic. Maybe in an earlier step than before, so they didn’t get parent measured size yet, but already taking space, inversing the measurement logic, now parent has to adapt to them instead. And this happiness is totally regardless of vertical and horizontal layout options. And on iOS/Catalyst only…
Is this iOS? If so, I would recommend using a Time Machine backup to roll back to the day before the update. This is easily done with Migration Assistant.