Bug 27765 - Labels misaligned in ViewCell
Summary: Labels misaligned in ViewCell
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.3.5
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-03-09 06:37 UTC by Maciej Czechowski
Modified: 2016-04-08 18:43 UTC (History)
6 users (show)

Tags: ac ios layout visual
Is this bug a regression?: ---
Last known good build:

Sample project (3.60 MB, application/zip)
2015-03-09 06:37 UTC, Maciej Czechowski
a (6.54 MB, application/x-zip-compressed)
2015-06-01 17:38 UTC, Chris King

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:

Description Maciej Czechowski 2015-03-09 06:37:04 UTC
Created attachment 10211 [details]
Sample project

(Relates to iOS)

The layout mechanism used in Forms seems to be creating misaligned views.
Simple reproduction steps:
1. Create a ViewCell with a label, vertically centered
2. Add it to the TableView
3. Add a normal TextCell (one that will be natively rendered)
4. Run simulator

The ViewCell will look aliased, while the native cell is sharp and clear. The [Debug/Color Misaligned Images] option in simulator will clearly show, that a custom label is misaligned. It looks as if the layout mechanism produced frames with positions/sized that do not match pixels (not with the 1f/0.5f resolution). This not only looks bad, but also can have a impact on performance (for the older devices).

The sample solution illustrates the problem. It is visible on all devices, but for iPad2 (non retina) it is very clear (maybe not a good word, since it is blurred ;))
Comment 1 Jason Smith [MSFT] 2015-03-09 16:14:11 UTC
Should be fixed in 1.4.1-pre1
Comment 2 Maciej Czechowski 2015-03-10 12:03:47 UTC
Looks pretty good on modern devices now, but on iPad2 (non-retina) the text is still blurred (and simulator shows misalignment).
Guess that for this device the frames should be set to integer numbers?
Comment 3 Chris King 2015-06-01 17:38:45 UTC
Created attachment 11414 [details]
Comment 4 Chris King 2015-06-01 17:39:29 UTC
Indeed. Looks fuzzy on iPad 2.

			MainPage = new ContentPage {
				Content = new TableView {
					Intent = TableIntent.Data,
					Root = new TableRoot {
						new TableSection("Custom") {
							new ViewCell() {
								View = new Label { Text = "Fuzzy" }
							new TextCell() {
								Text = "Not Fuzzy"
Comment 5 Jason Smith [MSFT] 2016-04-08 18:43:40 UTC
Thank you for taking the time to submit this report. After reviewing the description of this bug, we believe it no longer affects the current version of Xamarin.Forms. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.
For your convenience, we have created some reproduction best practices viewable here: https://gist.github.com/jassmith/92405c300e54a01dcc6d

Warm regards,
Xamarin Forms Team