Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the Label height within VerticalStackLayout is truncated when width is set #25748

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

NanthiniMahalingam
Copy link
Contributor

Root cause

  • When setting the width request explicitly on a vertical layout, the layout content of the label does not update its width and height constraints correctly. When setting the width request in label inside the vertical layout, the layout content of the label does not update its width and height constraints correctly. It causes the label text cropped.
  • This is due to a missing explicit calculation for the label and layout in the GetDesiredSizeFromHandler(this IViewHandler viewHandler, double widthConstraint, double heightConstraint) method in the ViewHandlerExtension.iOS class.

Description of changes

  • Included the IsExplicitSet calculation for layout and label to update the width and height constraints.

Issues Fixed

Fixes #15559

Tested the behavior in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

ScreenShot

iOS

Before After

macOS

Before After

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Nov 8, 2024
@jsuarezruiz jsuarezruiz added area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter area-controls-label Label, Span labels Nov 11, 2024
@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

public void LabelDisplayWithoutCroppingInsideVerticalLayout()
{
App.WaitForElement("Label");
VerifyScreenshot();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Windows snapshot is pending, already available in the latest build.
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jsuarezruiz ,
Included the snapshot for the Windows platform. Could you please check and let me know?

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-label Label, Span area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter community ✨ Community Contribution platform/iOS 🍎
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Layout Error: Label height within VerticalStackLayout is truncated when width is set
3 participants