dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.26k stars 1.76k forks source link

Rendering problem when Image and Label are placed inside StackLayout #25769

Closed thomasgalliker closed 1 week ago

thomasgalliker commented 1 week ago

Description

It seems as there is a rendering bug when I place an image and a label inside a StackLayout and align them horizontally. When the StackLayout uses Orientation=Horizontal, the Label's text overruns the layout boundries of the parent StackLayout (as well as the parent Grid) control.

Image Image

In our production app, we experience similar issues (sadly not reproducible). If we flip StackLayout.Spacing from "4" to "5" the text is tail truncated even if there is enough horizontal space available.

Image Image

Steps to Reproduce

  1. Create new .NET MAUI app.
  2. Update MainPage.xaml: Add ScrollView + Grid + StackLayout (Orientation=Horizontal).
  3. Inside the StackLayout, add an Image and a Label.
  4. The Label needs to have enough text and LineBreakMode=TailTruncation.
  5. Flip between StackLayout=Horizontal and Vertical. Observe what happens with the long text in the Label.

(See MauiApp4 reproduction repository).

Link to public reproduction project repository

https://github.com/bugsinkhole/MauiApp4

Version with bug

8.0.92 SR9.2

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

No response

Affected platforms

Android

Affected platform versions

Android 14

Did you find any workaround?

No.

Relevant log output

similar-issues-ai[bot] commented 1 week ago

We've found some similar issues:

If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.

Note: You can give me feedback by 👍 or 👎 this comment.

mattleibow commented 1 week ago

Duplicate of https://github.com/dotnet/maui/issues/18034

mattleibow commented 1 week ago

Duplicate of https://github.com/dotnet/maui/issues/10568