Bug 55397 - Text in Entry on UWP has vertical alignment irregularity
Summary: Text in Entry on UWP has vertical alignment irregularity
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows ()
Version: 2.3.3
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Chris King
URL:
Depends on:
Blocks:
 
Reported: 2017-04-19 17:41 UTC by John Hardman
Modified: 2017-05-04 15:38 UTC (History)
5 users (show)

Tags: UWP FontSize Default VerticalTextAlignment Entry ac
Is this bug a regression?: ---
Last known good build:


Attachments
Screenshot showing problem (15.22 KB, image/png)
2017-04-19 17:41 UTC, John Hardman
Details
Reproduction project (323.90 KB, application/x-zip-compressed)
2017-04-21 15:40 UTC, Paul DiPietro [MSFT]
Details
Entry fields after fix (44.48 KB, image/jpeg)
2017-04-26 17:29 UTC, Chris King
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description John Hardman 2017-04-19 17:41:31 UTC
Created attachment 21636 [details]
Screenshot showing problem

The code below is a ContentPage implementation. Push this onto the navigation stack. The code shows five Entry views, each with a different FontSize (Micro, Small, Default, Medium, Large). On UWP, using XF 2.3.3.193, the PlaceholderText (and Text once entered) for the Entry with Default FontSize is shown significantly above center (see attached image). It's more obvious with some fonts than others (it shows clearly using both "Arial" and "Agency FB"). Whilst other FontSizes appear to have results fractionally above center, for the Default FontSize the difference is significant.


using Xamarin.Forms;

namespace ViewsUsingXamarinForms
{
    public class BugEntryVerticalAlignmentPageView : ContentPage
    {
        public BugEntryVerticalAlignmentPageView()
        {
            Color backgroundColor = Color.White;
            Color textColor = Color.Black;
            Color placeholderColor = Color.Silver;
            string fontFamily = "Arial"; // "Agency FB";

            Entry entryMicroSize = new Entry
            {
                BackgroundColor = backgroundColor,
                TextColor = textColor,
                PlaceholderColor = placeholderColor,
                FontFamily = fontFamily,
                FontSize = Device.GetNamedSize(NamedSize.Micro, typeof (Entry)),
                Placeholder = "This is micro size"
            };

            Entry entrySmallSize = new Entry
            {
                BackgroundColor = backgroundColor,
                TextColor = textColor,
                PlaceholderColor = placeholderColor,
                FontFamily = fontFamily,
                FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Entry)),
                Placeholder = "This is small size"
            };

            Entry entryDefaultSize = new Entry
            {
                BackgroundColor = backgroundColor,
                TextColor = textColor,
                PlaceholderColor = placeholderColor,
                FontFamily = fontFamily,
                FontSize = Device.GetNamedSize(NamedSize.Default, typeof(Entry)),
                Placeholder = "This is default size"
            };

            Entry entryMediumSize = new Entry
            {
                BackgroundColor = backgroundColor,
                TextColor = textColor,
                PlaceholderColor = placeholderColor,
                FontFamily = fontFamily,
                FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Entry)),
                Placeholder = "This is medium size"
            };

            Entry entryLargeSize = new Entry
            {
                BackgroundColor = backgroundColor,
                TextColor = textColor,
                PlaceholderColor = placeholderColor,
                FontFamily = fontFamily,
                FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Entry)),
                Placeholder = "This is large size"
            };

            this.Content = new StackLayout
            {
                VerticalOptions = LayoutOptions.CenterAndExpand,
                Children =
                {
                    entryMicroSize,
                    entrySmallSize,
                    entryDefaultSize,
                    entryMediumSize,
                    entryLargeSize
                }
            };

        }
    }

} // namespace ViewsUsingXamarinForms

// eof
Comment 1 Paul DiPietro [MSFT] 2017-04-21 15:40:17 UTC
Attaching a reproduction project to this but there does appear to be slight differences.
Comment 2 Paul DiPietro [MSFT] 2017-04-21 15:40:37 UTC
Created attachment 21703 [details]
Reproduction project
Comment 4 Chris King 2017-04-26 17:29:52 UTC
Created attachment 21815 [details]
Entry fields after fix
Comment 5 Rui Marinho 2017-05-04 15:38:28 UTC
Should be fixed on 2.3.6-pre1