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.16k stars 1.74k forks source link

Vertical Text Alignment Not Working in Entry Control on Android Platform #24682

Closed surya3655 closed 1 month ago

surya3655 commented 1 month ago

Description

The vertical text alignment in the Entry control is not functioning correctly when the HeightRequest property is not explicitly set. Under normal circumstances, the Entry control should vertically align the text based on the specified alignment settings (e.g., VerticalTextAlignment = TextAlignment.Center). However, when the height is left unspecified or relies on the default layout behavior, the vertical alignment does not behave as expected.

Without setting the HeightRequest, the Entry control appears to ignore the vertical alignment setting, causing the text to remain aligned at the top by default. This issue becomes especially noticeable in scenarios where the Entry control is placed inside containers like Horizontal Stack layout on Andorid platform it's work fine in winodws.

Output

Android image Windows image

Steps to Reproduce

  1. Create a custom view that inherits from the HorizontalLayout.
  2. Add the Entry control and a bindable property for vertical text alignment.
  3. Load the custom view inside the HorizontalLayout and set the vertical text alignment to End.
  4. Once the app is loaded on Android, focus on the Entry and observe that the cursor remains at the top.

Link to public reproduction project repository

https://github.com/surya3655/TextAlignmentIssue

Version with bug

8.0.82 SR8.2

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 13

Did you find any workaround?

No

Relevant log output

No response

github-actions[bot] commented 1 month ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

Zhanglirong-Winnie commented 1 month ago

This issue has been verified using Visual Studio 17.12.0 Preview 1.0(8.0.72 & 8.0.82 & 8.0.80). Can repro on Android platform.

mattleibow commented 1 month ago

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