Skip to content

[Mobile][Skia][Wasm] cannot set the ItemsPanelTemplate to be a StackPanel on FlipView  #13944

@Marc-Antoine-Soucy

Description

@Marc-Antoine-Soucy

Current behavior

When you set the ItemsPanelTemplate to be a stackpanel on IOS, it throws an exception
image
On android it looks like this:
image
On skia and WASM, it doesnt show up
image

Expected behavior

It should be like on windows, where you can do it so that the height is set automatically
image
Instead of having to set a hardcoded height.

How to reproduce it (as minimally and precisely as possible)

In the MainPage

<StackPanel>
	<FlipView x:Name="flipView">
		<FlipViewItem>
			<Border Background="LightBlue"
					Height="500">
				<TextBlock Text="Item 1"
						   FontSize="30"
						   HorizontalAlignment="Center"
						   VerticalAlignment="Center" />
			</Border>
		</FlipViewItem>
		<FlipViewItem>
			<Border Background="LightGreen"
					Height="500">
				<TextBlock Text="Item 2"
						   FontSize="30"
						   HorizontalAlignment="Center"
						   VerticalAlignment="Center" />
			</Border>
		</FlipViewItem>
		<FlipViewItem>
			<Border Background="LightCoral"
					Height="500">
				<TextBlock Text="Item 3"
						   FontSize="30"
						   HorizontalAlignment="Center"
						   VerticalAlignment="Center" />
			</Border>
		</FlipViewItem>
		<FlipView.ItemsPanel>
			<ItemsPanelTemplate>
				<StackPanel Orientation="Horizontal" />
			</ItemsPanelTemplate>
		</FlipView.ItemsPanel>
	</FlipView>

	<TextBlock Text="Can see this" />
</StackPanel>

BasicApp.zip

Workaround

You can hardcode a height to be the same as the expected height

Works on UWP/WinUI

Yes

Environment

No response

NuGet package version(s)

<PackageReference Include="Uno.Resizetizer" Version="1.2.0-dev.68" />
<PackageReference Include="Uno.WinUI" Version="5.0.0-dev.3407" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.1.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
<PackageReference Include="Uno.Extensions.Logging.OSLog" Version="1.7.0-dev.1" />
<PackageReference Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="5.0.0-dev.3407" />
<PackageReference Include="Uno.WinUI.RemoteControl" Version="5.0.0-dev.3407" Condition="'$(Configuration)'=='Debug'" />

Affected platforms

WebAssembly, Android, iOS, Skia (GTK on Linux/macOS/Windows)

IDE

Visual Studio 2022

IDE version

17.7.4

Relevant plugins

No response

Anything else we need to know?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/porting 🖨️Categorizes an issue or PR as relevant for porting of WinUI codedifficulty/challenging 🤯Categorizes an issue for which the difficulty level is reachable with internals understandinghas-repro-branchkind/bugSomething isn't workingproject/items 🧾Categorizes an issue or PR as relevant to items (ItemsControl, ItemsRepeater, ...)triage/potentially-fixedCategorizes an issue as potentially fixed by some unlinked PR, fix needs to be verified

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions