dotnet / dotnet/maui

flexaligncontent.center results in a blank screen

Open
#5,697 12 comments 0 reactions 0 assignees View on GitHub
area-layout layout-flex p/2 partner/syncfusion platform/android platform/windows s/triaged s/verified t/bug
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 10h
Merged PRs (30d)
297

Description

### Description

This layout results in a blank screen on Windows and Android:

```
public class FlexLayoutSample : ContentPage
{
public FlexLayoutSample()
{
Content = new FlexLayout
{
Direction = FlexDirection.Row,
Wrap = FlexWrap.Wrap,
AlignContent = FlexAlignContent.Center,
Children = {
new Label { Text = "Welcome to",
BackgroundColor = DarkBlue },
new Image { Source = "dotnet_bot.png"},
new Label { Text = ".NET MAUI",
BackgroundColor = DarkOliveGreen }
}
};
}}
```

Without the "AlignContent = FlexAlignContent.Center" it works fine.

### Steps to Reproduce

```
public class FlexLayoutSample : ContentPage
{
public FlexLayoutSample()
{
Content = new FlexLayout
{
Direction = FlexDirection.Row,
Wrap = FlexWrap.Wrap,
AlignContent = FlexAlignContent.Center,
Children = {
new Label { Text = "Welcome to",
BackgroundColor = DarkBlue },
new Image { Source = "dotnet_bot.png"},
new Label { Text = ".NET MAUI",
BackgroundColor = DarkOliveGreen }
}
};
}}
```

### Version with bug

Preview 14 (current)

### Last version that worked well

Unknown/Other

### Affected platforms

Android, Windows

### Affected platform versions

Windows sdk 10.0.19041, Android api 31

### Did you find any workaround?

_No response_

### Relevant log output

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.