Bug 6703 - Margins are scaled by 1.5
Summary: Margins are scaled by 1.5
Status: RESOLVED INVALID
Alias: None
Product: Android
Classification: Xamarin
Component: BCL Class Libraries ()
Version: 4.2.x
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-08-27 10:10 UTC by Milos
Modified: 2012-08-30 09:51 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Test project demonstrating the bug. (10.47 KB, application/x-zip)
2012-08-27 10:10 UTC, Milos
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 INVALID

Description Milos 2012-08-27 10:10:20 UTC
Created attachment 2414 [details]
Test project demonstrating the bug.

When setting margin on LayoutParams and using this params when adding view to a layout, its position will be margin * 1.5
i.e. when I set TopMargin = 100 then view's Top position = 150

	var layout = new FrameLayout(this);
	var text = new TextView(this);
	var lParams = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.FillParent, FrameLayout.LayoutParams.FillParent);
	lParams.Gravity = GravityFlags.Center;
	lParams.TopMargin = 100;
	lParams.LeftMargin = 10;
	layout.AddView(text, lParams);

After view is displayed text.Top == 150 and text.Left == 15
Margin values stay unchanged (lParams.TopMargin == 100 and lParams.LeftMargin == 10)

Same code made in Java works.
Comment 1 Milos 2012-08-30 09:51:20 UTC
Sorry, it was caused by
    lParams.Gravity = GravityFlags.Center;