maui icon indicating copy to clipboard operation
maui copied to clipboard

CollectionView items layout is not changed when GridItemsLayout.Span is changed on iOS and Windows

Open vg12345 opened this issue 3 years ago • 3 comments

Description

CollectionView items layout is not changed when GridItemsLayout.Span is changed on iOS and Windows - columns number remains the same. Works fine on Android.

Additional problem: trying to change the span without Dispatcher causes crash on iOS (!)

Reproduced on: Visual Studio 17.3.4 Windows 11 desktop iPhone device with iOS 15.6.1

Attached: MauiApp1 source code that demonstrates the bug MauiApp1.zip

Steps to Reproduce

Bug 1

  1. Open MauiApp1 application
  2. Click the button to change layout span
  3. Items layout is not changed on iOS and Windows

Bug 2

  1. Go to OnButtonClicked implementation, eliminate dispatching and try to change span directly.
  2. Recompile
  3. Open MauiApp1 on iOS
  4. Click the button to change layout span
  5. Application is crashing

MauiApp1.zip

Link to public reproduction project repository

https://github.com/dotnet/maui/files/9574398/MauiApp1.zip

Version with bug

6.0.486 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS, Windows

Affected platform versions

iOS 15.6.1, Windows SDK 10.0.22000.194

Did you find any workaround?

No response

Relevant log output

No response

vg12345 avatar Sep 15 '22 10:09 vg12345

Please, add label for Windows too

vg12345 avatar Sep 15 '22 11:09 vg12345

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

ghost avatar Sep 15 '22 18:09 ghost

I can confirm this. It works as expected on Android, but not on Windows. My repro:

https://github.com/pekspro/MauiIssues/tree/10144_CollectionView_items_layout_is_not_changed

pekspro avatar Oct 14 '22 21:10 pekspro

Span (set in Xaml) was working on .net 6 Windows for me. Broken with .net 7

mdbill avatar Dec 12 '22 03:12 mdbill

Span (set in Xaml) was working on .net 6 Windows for me. Broken with .net 7

Span CHANGING is not working. With .net 6 too.

vg12345 avatar Dec 12 '22 10:12 vg12345

Span (set in Xaml) was working on .net 6 Windows for me. Broken with .net 7

I played around with CenterAndExpand on a few elements and replaced some FillAndExpand's and one of those changes actually made Span 2 work. But I'll need span changes too - as @vg12345 noted: this, and many other layout issues with collectionview are not working. Example: A little off topic, but the width doesn't stay fully expanded with window resizes. This also used to work in .net 6. Might be able to get a workaround now that .net7 can do this:

protected override Window CreateWindow(IActivationState activationState)
	{
		Window window = base.CreateWindow(activationState);
#if NET7_0_OR_GREATER
		window.MinimumWidth = 500;
		window.MinimumHeight = 500;

		window.Width = 800;
		window.Height = 1024;
		window.SizeChanged += (s, e) =>
		{
		};
#endif
		return window;
	}

mdbill avatar Dec 12 '22 14:12 mdbill

My project also got affected

Strypper avatar Jan 19 '23 15:01 Strypper

#13137 is a fix fo Windows. Is this issue fixed for iOS?

vg12345 avatar Mar 24 '23 09:03 vg12345